Posted on May 16, 2007
(permalink)
I am having a similar (if not the same) problem with my DotNetNuke module. After I call the ExportToExcel() function the spreadsheet opens in a new window. Then I click on something in my old window (i.e. an edit link in my grid - or something with do_postback) and it works the first time, but immediately stops working. Alternatively, if I export the spreadsheet, then navigate to the page which originally called my page (which also has a grid in it), the grid also stops working there as well, even though it is a totally different page.
I have to close and reopen my browser and/or logout and login to my dnn site - but this doesn't always fix the problem. Sometimes waiting a period of time say 15 seconds, or sometimes 5 minutes, then trying again will fix the page again. And - to top it all off, this only happens some of the time and not others using the same action on my page. But one thing I did notice is that it seems to happen more when I am exporting larger grids i.e. 85 items vs smaller grids i.e. 2 items. Here is the code I am using on the server side:
Protected Sub btnExport_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExport.Click
rgrdDockReceiptLineItems.ExportSettings.ExportOnlyData = True
rgrdDockReceiptLineItems.ExportSettings.IgnorePaging = True
rgrdDockReceiptLineItems.ExportSettings.OpenInNewWindow = True
rgrdDockReceiptLineItems.MasterTableView.ExportToExcel()
End Sub