在生产中从ReportViewer导出到Excel但在开发中不导出时出错

时间:2011-10-24 22:45:26

标签: asp.net reporting-services

我有一个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)

令我困惑的两件事是:

  1. 当数据明显加载而基础数据库没有错误时,为什么导出失败,
  2. 导出在暂存环境中工作正常,即使我将开发环境连接字符串指向生产数据库也是如此!为什么我可以在开发环境中导出完全相同的数据但不是在生产?
  3. 有什么想法在这里发生了什么?我的谷歌搜索引发了很多关于使用完整的SSRS和远程报告的人们的讨论,但是我无法找到任何针对本地报告文件的潜在解决方法。

    由于

0 个答案:

没有答案