Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 737
  • Last Modified:

How to export data to Excel spreadsheet from ASP.NET application?

I am working on a ASP.NET 2.0 application, which requires to export the data to an excel spreadsheet.
It requires:
(1) Tabbed. So need to create multiple tabs. Each tab has its own name.
(2) Might require color coded contents
(3) Requires column name
(4) It will show some special line item, such as sub total (on spread sheet, just show the number) on some of the column. So it is not as easy as export a whole dataset or dataview.

How do I do this? I have seen some examples for winform, but NOT webform. The ideal solution would include the dialog box for user to save or open.

How do I achieve this?
0
chuang4630
Asked:
chuang4630
  • 3
1 Solution
 
jonorossiCommented:
You can use use automation to build the document using Excel on the server and send the bytes down to the client to save to their disk like these articles:
http://support.microsoft.com/kb/302084
http://www.codeproject.com/csharp/Simple_Excel_Automation.asp

Or you can get a component that doesn't require excel to be installed on the server and can build excel files in memory in pure 100% managed code like these ones:
http://www.syncfusion.com/products/xlsio/web/default.aspx
http://www.spreadsheetgear.com/products/spreadsheetgear.net.aspx
0
 
jonorossiCommented:
I just found this Excel library that is free which might be of use:
http://www.carlosag.net/Tools/ExcelXmlWriter/Default.aspx
0
 
jonorossiCommented:
I provided chuang4630 a list of products he could use and didn't hear anything back. Either he choose one from the list and didn't close the question or he was happy with the answer but didn't say so. I believe the products I listed would do what was being asked for.
0
 
Computer101Commented:
Forced accept.

Computer101
EE Admin
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now