string strq="Select query"; DataSet ds1 = obj.GetDataset(strq); // Get the datatable to export System.Data.DataTable dtEmployee = ds1.Tables[0].Copy(); //Export all the details to Excel RKLib.ExportData.Export objExport = new RKLib.ExportData.Export("Win"); int[] iColumns = { 0 }; string[] Headers = {"Total amt"}; string str = ConfigurationSettings.AppSettings["Potkirdpath"]; string filename = "path" string date = DateTime.Today.Year.ToString() + DateTime.Today.ToString("MM") + DateTime.Today.ToString("dd"); string time = System.DateTime.Now.ToString("ddMMyyyy_hhmmsstt"); if (!Directory.Exists(str)) { Directory.CreateDirectory(str); } string fullPath = str + "\\" + filename + "-" + time.ToString() + ".xls"; objExport.ExportDetails(dtEmployee, iColumns, Headers, Export.ExportFormat.Excel, fullPath);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)