Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I want to extract the datas from the database and fill it to the excel sheet. I am saving the excel template in one folder. When I click the download from excel button the excel sheet should fill all the cells in all the tabs of the excel sheet and save that to some other folder. Can anyone help me to solve this problem.

Thanks in Advance
Posted

Hi,
You can use ExcelPackage,
http://excelpackage.codeplex.com/[^]
It's very easy to use and they got some examples of code using template on the site.
Hope this help you.
 
Share this answer
 
Excel has a built-in mechanism for importing data from external sources. You can use data connections to define a query to your database which fills data to excel. For more info: http://office.microsoft.com/en-us/excel-help/create-edit-and-manage-connections-to-external-data-HA010167227.aspx[^]

The saving can after that be done from c# (which you tagged) or with an excel macro etc.
 
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