ReportCacheMode and Export to Excel
Posted: Mon May 25, 2015 8:26 pm
Hi,
We are having problems when our users try to export reports to Excel when the reports are set to use Cache (ReportCacheMode = On). We use this mode when a report contains many images.
To reproduce the problems, I have created a small application, StimulsoftCacheModeTest. It will open the report viewer, and you can then choose how to export to Excel. Click Save >> Microsoft Excel File.
1/ Check Export Data Only. The report is supposed to display rows 1 to 500, but on the report, only the first 423 rows will be displayed. In addition, the footers are not supposed to be displayed when Export Data Only is checked.
2/ Export again, this time check "Use One Page Header and Footer". The page numbers will be displayed, and the header will be repeated for each page, instead of only one header at the top of the Excel sheet.
3/ I could not reproduce it with the sample application, but if both Export Data Only and Export Object Formatting are checked, on some reports I have the "Exception Report" Window from Stimulsoft with this exception: "Index was outside the bounds of the array." (see the stack trace below)
If you uncomment _stiReport.ReportCacheMode = StiReportCacheMode.On and run the application again, all options will work as expected.
Thank you
----------------------------
[Exception Info]
Message: Index was outside the bounds of the array.
Source: Stimulsoft.Report
StackTrace:
at Stimulsoft.Report.Export.StiExcel2007ExportService.WriteSheet(Int32 indexSheet, StiPage page)
at Stimulsoft.Report.Export.StiExcel2007ExportService.ExportExcel(StiReport report, Stream stream, StiExcelExportSettings settings)
at Stimulsoft.Report.StiReport.ExportDocument(StiExportFormat exportFormat, StiExportService exportService, Stream stream, StiExportSettings settings)
at Stimulsoft.Report.Export.StiExportService.DoExport(StiExportInfo info)
at Stimulsoft.Report.Export.StiExportService.StartExport(StiReport report, Stream stream, StiExportSettings settings, Boolean sendEMail, Boolean openAfterExport, String fileName, StiGuiMode guiMode)
at Stimulsoft.Report.Export.StiExcelExportService.form_Complete(IStiFormRunner form, StiShowDialogCompleteEvetArgs e)
at Stimulsoft.Report.Export.StiExcelExportService.Export(StiReport report, String fileName, Boolean sendEMail, StiGuiMode guiMode)
at Stimulsoft.Report.Viewer.StiViewerControl.OnProcessExport(Object sender)
at Stimulsoft.Report.Viewer.StiViewerControl.cmExport_Click(Object sender, EventArgs e)
----------------------------
We are having problems when our users try to export reports to Excel when the reports are set to use Cache (ReportCacheMode = On). We use this mode when a report contains many images.
To reproduce the problems, I have created a small application, StimulsoftCacheModeTest. It will open the report viewer, and you can then choose how to export to Excel. Click Save >> Microsoft Excel File.
1/ Check Export Data Only. The report is supposed to display rows 1 to 500, but on the report, only the first 423 rows will be displayed. In addition, the footers are not supposed to be displayed when Export Data Only is checked.
2/ Export again, this time check "Use One Page Header and Footer". The page numbers will be displayed, and the header will be repeated for each page, instead of only one header at the top of the Excel sheet.
3/ I could not reproduce it with the sample application, but if both Export Data Only and Export Object Formatting are checked, on some reports I have the "Exception Report" Window from Stimulsoft with this exception: "Index was outside the bounds of the array." (see the stack trace below)
If you uncomment _stiReport.ReportCacheMode = StiReportCacheMode.On and run the application again, all options will work as expected.
Thank you
----------------------------
[Exception Info]
Message: Index was outside the bounds of the array.
Source: Stimulsoft.Report
StackTrace:
at Stimulsoft.Report.Export.StiExcel2007ExportService.WriteSheet(Int32 indexSheet, StiPage page)
at Stimulsoft.Report.Export.StiExcel2007ExportService.ExportExcel(StiReport report, Stream stream, StiExcelExportSettings settings)
at Stimulsoft.Report.StiReport.ExportDocument(StiExportFormat exportFormat, StiExportService exportService, Stream stream, StiExportSettings settings)
at Stimulsoft.Report.Export.StiExportService.DoExport(StiExportInfo info)
at Stimulsoft.Report.Export.StiExportService.StartExport(StiReport report, Stream stream, StiExportSettings settings, Boolean sendEMail, Boolean openAfterExport, String fileName, StiGuiMode guiMode)
at Stimulsoft.Report.Export.StiExcelExportService.form_Complete(IStiFormRunner form, StiShowDialogCompleteEvetArgs e)
at Stimulsoft.Report.Export.StiExcelExportService.Export(StiReport report, String fileName, Boolean sendEMail, StiGuiMode guiMode)
at Stimulsoft.Report.Viewer.StiViewerControl.OnProcessExport(Object sender)
at Stimulsoft.Report.Viewer.StiViewerControl.cmExport_Click(Object sender, EventArgs e)
----------------------------