I have an export button that when clicked, retrieves the date set in two RadDatePickers and then exports the results of all incidents between those two dates. I also have a label that is empty if the export is successful or will display "Error: Query too large to export" if the query is too large to export to excel (this is all in a try/catch statement).
I have 2 issues. The first is concerning the error. The label was not being updated so I placed the label change in the try statement before the ExportToExcel method just to see if it was working. If I comment out the RadGrid.MasterTableView.ExportToExcel() line, it works perfectly. However, with this line, it won't work. By won't work, I mean the export works perfectly fine but the label is never updated. Also the try/catch statement does not work at all and I wonder if that is due to the same problem.
The second issue, is that ExportToExcel() used to export to Excel 2003 while ExportToExcel2007() obviously used to export to Excel 2007. Now, ExportToExcel2007() is deprecated. Limiting the query is not an option for our system. Is there a way to export to Excel 2007? I tried using ExportToExcel() in hopes that since the two methods were combined, it would export to the latest version but it is still exporting to 2003 with a .xls extension.
If someone could help solve these two problems that would be extremely helpful!
Thanks in advance!
Emily
Update:
On further inspection of the first issue, I have found the following code in a javascript file:
I have 2 issues. The first is concerning the error. The label was not being updated so I placed the label change in the try statement before the ExportToExcel method just to see if it was working. If I comment out the RadGrid.MasterTableView.ExportToExcel() line, it works perfectly. However, with this line, it won't work. By won't work, I mean the export works perfectly fine but the label is never updated. Also the try/catch statement does not work at all and I wonder if that is due to the same problem.
The second issue, is that ExportToExcel() used to export to Excel 2003 while ExportToExcel2007() obviously used to export to Excel 2007. Now, ExportToExcel2007() is deprecated. Limiting the query is not an option for our system. Is there a way to export to Excel 2007? I tried using ExportToExcel() in hopes that since the two methods were combined, it would export to the latest version but it is still exporting to 2003 with a .xls extension.
If someone could help solve these two problems that would be extremely helpful!
Thanks in advance!
Emily
Update:
On further inspection of the first issue, I have found the following code in a javascript file:
function
pnlRequestStarted(ajaxPanel, eventArgs)
{
if(eventArgs.EventTarget.indexOf("btnExport") != -1)
{
eventArgs.EnableAjax =
false;
}
}
The problem is, I need to set this back to true I believe in order to update the label and allow the try/catch statement to function properly. Any ideas? Thanks!