I have an ASP.NET application. I want to implement excel export.
I want to export a dataset to excel file.
Also I want to use the existing template file(myTemplate.xltx) which has header footer logo.
I searched the forum and help samples but I didn't get any example to export using template file.
Please give me some sample code to export a dataset using a Template file.
Thanks in Advance,
Utkarsh Bandekar
You can load the template file using the static Workbook.Load method, which returns a Workbook instance. Then you can call SetCurrentFormat on that instance and pass in WorkbookFormat.Excel2007 to convert it to a normal workbook format. Then export the data to a worksheet within the workbook and save it out with the Workbook's Save method.