我有一个ASP.NET 2.0应用程序,它使用内置的ReportViewer控件在网页上显示本地报表文件。 ReportViewer绑定到Typed DataSet,它通过ObjectDataSource填充,后者在SQL 2005数据库上查询存储过程。用户可以进入页面,设置各种参数,然后查看报告。
在ReportViewer中查看报告时,一切都运行良好。数据按预期加载到网格中。但是,内置到ReportViewer控件中的“导出到Excel”选项会使不工作。也就是说,在出口时,我受到了例外的欢迎:
System.IndexOutOfRangeException: Index was outside the bounds of the array.
Generated: Mon, 24 Oct 2011 22:40:57 GMT
Microsoft.Reporting.WebForms.LocalProcessingException: An error occurred during local report processing. ---> Microsoft.ReportingServices.ReportProcessing.WrapperReportRenderingException: An error occurred during rendering of the report. ---> Microsoft.ReportingServices.ReportRendering.ReportRenderingException: An error occurred during rendering of the report. ---> System.IndexOutOfRangeException: Index was outside the bounds of the array.
--- End of inner exception stack trace ---
at Microsoft.Reporting.WebForms.LocalReport.InternalRender(String format, Boolean allowInternalRenderers, String deviceInfo, CreateAndRegisterStream createStreamCallback, Warning[]& warnings)
at Microsoft.Reporting.WebForms.LocalReport.InternalRender(String format, Boolean allowInternalRenderers, String deviceInfo, String& mimeType, String& encoding, String& fileNameExtension, String[]& streams, Warning[]& warnings)
at Microsoft.Reporting.WebForms.LocalReport.Render(String format, String deviceInfo, String& mimeType, String& encoding, String& fileNameExtension, String[]& streams, Warning[]& warnings)
at Microsoft.Reporting.WebForms.LocalReportControlSource.RenderReport(String format, String deviceInfo, NameValueCollection additionalParams, String& mimeType, String& fileNameExtension)
at Microsoft.Reporting.WebForms.ExportOperation.PerformOperation(NameValueCollection urlQuery, HttpResponse response)
at Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
令我困惑的两件事是:
有什么想法在这里发生了什么?我的谷歌搜索引发了很多关于使用完整的SSRS和远程报告的人们的讨论,但是我无法找到任何针对本地报告文件的潜在解决方法。
由于