locked
excel reporting through vb.net RRS feed

  • Question

  • User-934954367 posted

     i want to open an excel workbook on the server thorough asp.net dump data
    from a database and save it on the server and then allow the user to either
    open or save that xls file. i am using the following code:
    xlWorkBook = New Excel.Application().Workbooks.Open(path, Type.Missing, False, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,

    Type.Missing) 'to open the workbook


    xlWorkSheet = xlWorkBook.Worksheets("EffortsData") 'to get worksheet object of a particular worksheet


    xlWorkSheet.SaveAs(path, Type.Missing, Type.Missing, Type.Missing, False, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing) 'to save

    while debugging code on the server and on my local machine it runs perfectly fine but while connecting through the website it gets stuck and gives no error.
    please help

    Friday, September 19, 2008 5:57 AM

All replies

  • User1150582658 posted

    I'm running into the same problem and no response yet on my posts.  I was told that excel shouldn't be used as a server side application like we are trying to use it, but there has to be a way around that.

    Monday, September 29, 2008 1:43 PM
  • User-934954367 posted

    i have found the solution first save a template and when dumping data open the same template but at the time of saving, save it as a different xls which you can provide the user. for more info visit this link http://forums.asp.net/p/1276062/2427471.aspx#2427471 

    Tuesday, September 30, 2008 1:11 AM