Need better solution to export from sql server to multiple worksheets in excel in vb.net 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 vb.net
    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
    appreciated.

    Thank you
    Nik
     
    Nik, Aug 10, 2003
    #1
    1. Advertisements

  2. Nik

    ardent.alan

    Joined:
    Mar 21, 2012
    Messages:
    1
    Likes Received:
    0
    vb.net 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
    #2
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sanju
    Replies:
    2
    Views:
    6,475
    verda
    Feb 23, 2009
  2. Replies:
    2
    Views:
    1,613
    Mark Rae
    Nov 27, 2006
  3. =?Utf-8?B?RGF2ZQ==?=

    Exporting to multiple excel worksheets from asp.net?

    =?Utf-8?B?RGF2ZQ==?=, Jan 26, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    2,376
    Mark Rae
    Jan 26, 2007
  4. hal
    Replies:
    2
    Views:
    3,069
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
    Mar 27, 2007
  5. Jona
    Replies:
    2
    Views:
    589
    Victor Bazarov
    Jul 6, 2007
  6. Shawn
    Replies:
    0
    Views:
    578
    Shawn
    Sep 26, 2003
  7. sridevi
    Replies:
    0
    Views:
    266
    sridevi
    May 10, 2005
  8. Replies:
    1
    Views:
    2,074
    Prasad, Ramit
    Feb 16, 2012
Loading...