Click here to Skip to main content
15,901,205 members
Please Sign up or sign in to vote.
4.00/5 (2 votes)
See more:
doubt in window application.how to insert header,logo in starting position in excel .after filling datatable value in excel,how to add new row showing Grand Total in one cell and sum of Total amt...

i have created excel report using RKLib.ExportData;
C#
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);

my excel report is created.i have 1 doubt how to insert header,logo in starting position.after filling dtemployee in excel.how to add new row showing Grand Total in one cell and sum of Total amt in one cell.
Posted
Updated 6-Jul-12 23:51pm
v2

1 solution

please see this article

create-xls-file-with-image-and-apply-function[^]

it's nice article and demonstrating what you want.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900