Need better solution to export from sql server to multiple worksheets in excel in app

Discussion in 'ASP .Net' started by Nik, Aug 10, 2003.

  1. Nik

    Nik Guest

    I have a VB.NET Web application. I have to export data from SQL Server
    to excel. I have 3 Select statements and the results need to go in 3
    separate worksheets and the column headers of the sheets are dynamic
    i.e. they change according to user criteria.

    Currently I am using SQL Server-'OPENDATASource' to export to Excel
    and prior to calling opendatasource I use excel automation in
    to create an excel file and write the column headers. This is because
    opendatasource expects column headers to be present in the sheet.

    2 problems:-
    1) It is slow
    2) It seems like I have to have excel installed on the server for
    excel automation to work, otherwise it gives me 'Cannot create ActiveX
    Component'. I do not want to install excel on the server due to
    security reasons.

    Is there a better way to approach the above scenario? Any help is

    Thank you
    Nik, Aug 10, 2003
    1. Advertisements

  2. Nik


    Mar 21, 2012
    Likes Received:
    0 Exporting DataSet Tables to Excel Without Inter Op

    I have a C# class that does this using a string Writer and xml. Once I get it converted I will post it here.
    ardent.alan, Mar 21, 2012
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.