views:

264

answers:

2

I have an ASP.NET 3.5 site that needs to export data to a pre-formatted Excel sheet. I am not allowed to modify the excel sheet in any way, just drop data into specific cells.

My question is, What is the simplest way to do this from an ASP.NET site. The user will always have Excel on their machine.

Is a 3rd party control my best option or is this a relatively simple task using VB.NET ?

+2  A: 

dear use ExcelPackage. It rocks!!! I've used it in my project. It can take a preformatted excel file and use it as template. It is also very easy to use.

TheVillageIdiot
I will check it out. Looks rather simple...too simple actually..
Khalid Rahaman
+1  A: 

Use NPOI (http://npoi.codeplex.com/) if you want Excel 2000-2003 compatibility, or ExcelPackage (http://excelpackage.codeplex.com/) if you're only targeting Excel 2007/2008.

I've also rolled my own XML output in the older SpreadsheetML format (Excel 2002/2003), it was MUCH easier than the newer OOXML (Excel 2007/2008) format.

richardtallent