首页 > 解决方案 > RDLC - 在 AspDotNet Core 项目中使用 RDLC - 本地报告处理期间发生错误。指数数组的边界之外

问题描述

如何修复:在 AspNet Core 项目中使用 RLDC 和 AspNetCore.ReportingServices 会引发异常,因为 “本地报告处理期间发生错误。索引超出了数组的范围。”

  1. 我有 .Net Winforms 项目来添加 RDLC 文件。我总是在 AspNet Core 项目中复制/粘贴 rdlc 文件 + 数据源。
  2. 尝试导出 pdf/excel 并引发上述异常。

注:随机。它有时会来。但通常在 IIS 服务器上部署时。任何建议/建议或帮助将不胜感激。

异常:异常出现在我们的 DontNetCore 项目中包含的 AspNetCore.ReportingServices nuget 包中。这是堆栈跟踪。

“在 AspNetCore.Reporting.InternalLocalReport.InternalRender(字符串格式,布尔 allowInternalRenderers,字符串 deviceInfo,PageCountMode 的 AspNetCore.Reporting.InternalLocalReport.InternalRender(字符串格式,布尔值 allowInternalRenderers,字符串 deviceInfo,PageCountMode pageCountMode,CreateAndRegisterStream createStreamCallback,警告 []& 警告)处)在 AspNetCore.Reporting.InternalLocalReport.Render(字符串格式,字符串 deviceInfo,PageCountMode pageCountMode,字符串和 mimeType,字符串和编码,字符串和文件名扩展, AspNetCore.Reporting.LocalReport.Execute(RenderType renderType, Int32 pageIndex, Dictionary 上的 String[]& 流、警告[]& 警告)2 parameters, String findString) at Tracs4Life.Service.ReportService.<GenerateReportAsync>d__21.MoveNext() in C:\D drive\MySpace\CompanyProjects\BsiTracks4Life\Source\Tracs4Life\Tracs4Life.Service\ReportService.cs:line 572 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() 在 Tracs4Life.Website.Controllers.ReportController.d__11.MoveNext() 在 C:\D drive\MySpace\CompanyProjects\BsiTracks4Life\Source\Tracs4Life\Tracs4Life.Website\Controllers\ReportController.cs:line 211"。

标签: asp.net-corereportingrdlc

解决方案


不要使用任何表达式,报告将失败。这是这个库的限制


推荐阅读