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

Posted on 2007-10-01
Last Modified: 2008-01-09
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?
Question by:chuang4630
    LVL 9

    Expert Comment

    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:

    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:
    LVL 9

    Accepted Solution

    I just found this Excel library that is free which might be of use:
    LVL 9

    Expert Comment

    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.
    LVL 1

    Expert Comment

    Forced accept.

    EE Admin

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
    This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now