Create Excel Workbook with asp.net

Discussion in 'ASP.NET / ASP.NET Core' started by alexvazquez, Mar 30, 2004.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I want to create an excel workbook in asp.net that runs here in Discountasp.net. I already made an application that can create an excel file from a dataset.. but I want to create a custom workbook. Insert data in selected cells and also change font style, etc.

    I have a table in the database that has 3 diferentes categories and each category has diferent topics, I want an aspx that can create an excel file and write, in the same sheet, the category and then the topics ,, then just after that insertion insert the next category with the correpondig topics and below...

    Please if someone can help me I will appreactie a lot because a have head aches witht his!

    Thanks a lot.

    Ing. Vazquez
     
  2. Ing.,

    A Pivot Table in the spreadsheet will let you group & format the data the way that you have described. The source of the Pivot Table has to be the raw, flat data.

    For instance, if you ran this:

     
  3. You can create an excel file by simply changing the content type to an excel content (using Response.ContentType = "application/excel")
    and then writing a table.

    Here is a sample. They show using contenttype application/csv but I have done it as application/excel and it worked great.

    Here is the link:
    http://forums.aspfree.com/showthread.php?t=19349
     
  4. Thanks, I already made it but in other form because I wanted to add some pictures also from code to excel. What I do it was to create a file on the server with .xls extension and then create with act.writeline the XML file that creates an excel file. It worked excelent and can be customized as I want.

    Thanks a lot..
     
  5. Hello. I wanted to do a similar thing by having my asp.net application create a Microsoft Word document using COM. I was under the impression that MS Word has to be installed on the particular discountasp.net web server that my app is running on, which the admins say it is not. So how did you get around this?
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page