reporting-services - 使用 Reporting Services 执行 Web 服务接收大型报告时出错

标签 reporting-services ssrs-2012 ssrs-2016

我有一个将照片数据存储在数据库中的应用程序。 SSRS 报告用于生成与特定实体相关的照片报告。生成此报告所需的信息存储在单独的数据库中,并且非常简单地将 ReportId 与多张照片相关联。 Reporting Services 执行 Web 服务用于以 Word 格式呈现报表并输出一个字节数组,然后由应用程序使用。

问题是,有一个非常明确且可重复的大小限制,超过该限制,应用程序将不会收到报告。在每种情况下,报告都已成功呈现,但从未根据 RS 日志发送响应:

rshost!rshost!1bfc!03/14/2018-21:46:48:: e ERROR: HttpPipelineCallback::SendResponse(): failed writing response.
rshost!rshost!1bfc!03/14/2018-21:46:48:: e ERROR: Failed with win32 error 0x0057, pipeline=0x0000027542592740.
httpruntime!ReportServer_0-1!1bfc!03/14/2018-21:46:48:: e ERROR: Failed in 
BaseWorkerRequest::SendHttpResponse(bool), exception=System.ArgumentException: Value does not fall within the expected range.
   at Microsoft.ReportingServices.HostingInterfaces.IRsHttpPipeline.SendResponse(Void* response, Boolean finalWrite, Boolean closeConn)
   at ReportingServicesHttpRuntime.BaseWorkerRequest.SendHttpResponse(Boolean finalFlush)
library!ReportServer_0-1!1bfc!03/14/2018-21:46:48:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.ReportServerHttpRuntimeInternalException: RsWorkerRequest::FlushResponse., Microsoft.ReportingServices.Diagnostics.Utilities.ReportServerHttpRuntimeInternalException: An internal or system error occurred in the HTTP Runtime object for application domain ReportServer_SSRS_0-1-131655000672564770. ---> System.ArgumentException: Value does not fall within the expected range.
   at ReportingServicesHttpRuntime.BaseWorkerRequest.SendHttpResponse(Boolean finalFlush)
   at ReportingServicesHttpRuntime.RsWorkerRequest.FlushResponse(Boolean finalFlush)
   --- End of inner exception stack trace ---;
rshost!rshost!1bfc!03/14/2018-21:46:48:: e ERROR: HttpPipelineCallback::SendResponse(): failed writing response.
rshost!rshost!1bfc!03/14/2018-21:46:48:: e ERROR: Failed with win32 error 0x10DD, pipeline=0x0000027542592740.

这似乎与服务 http 响应的某些大小限制直接相关,原因如下:

  • 请求本身很小,只是一个 Report Id 即 httpRuntime maxRequestLength 没有关系,这个已经测试过。
  • 错误发生在请求的几分钟内,即 httpRuntime executionTimeout 不相关,这已经过测试。
  • 我可以可靠且重复地将一张照片添加到报告中,但它会失败,删除一张照片,它可以毫无问题地呈现和发送,添加一张照片,它会失败...
  • 呈现的时间各不相同,因此它似乎与大小有关,而不是与超时有关。
  • 无论是否发送报表,报表服务器执行日志显示每次渲染成功。
  • 我使用通常调用报告的应用程序和单独的控制台应用程序重现了该错误,该应用程序仅生成 Web 服务客户端并尝试使用 Render2 方法以字节数组形式呈现和接收报告。
  • 我已在多个不同的报表服务器上使用 SQL Server 2012 和 SQL Server 2016 重现此错误,包括在本地设置报表服务器并在同一台机器上运行服务器和请求。
  • 无论照片的组合如何,报告始终会成功呈现,但无法发送约 238,000,000 字节数,即与某些不良数据无关。
  • 在所有情况下,我都能够通过报表服务器门户生成相同大小或更大的报表,没有任何问题。

有没有人在使用 RS 网络服务时遇到过类似的行为?我在网上广泛搜索但没有任何运气。对于如何解决此问题的任何建议,我们将不胜感激。

最佳答案

微软终于确定HttpSendResponseEntityBody作为错误的来源。该函数发送与 HTTP 响应关联的实体主体数据,并且根据 MSDN 具有以下参数:

EntityChunkCount [in] A number of structures in the array pointed to by pEntityChunks. This count cannot exceed 9999.

Microsoft 没有任何解决报告大小限制的 SSRS 文档。在这个阶段他们所做的只是建议“我们可以使用其他工具来提取数据”和“通常我们建议将数据小于 100MB 或者行数小于 1,000,000”。

关于reporting-services - 使用 Reporting Services 执行 Web 服务接收大型报告时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49366781/

相关文章:

sql - SSRS 2016 native 双跳 Windows 身份验证

ios - 构建呈现 Sql Server Reporting Services 报告的 iOS 应用程序

sql - SSRS在分组时组合来自多行的列内的值

sql - 根据参数值执行数据集-SSRS

reporting-services - SSRS 按多个字段和分组进行分组

c# - 在 C# 中从数据库生成 PDF 报告,特别是 ASP

c# - 如何在 C# 中更改 SSRS 报告的高度?

sql-server - 我可以在 ssrs 报告中添加一个过滤器按钮吗?

reporting-services - SSRS 2016 垂直对齐中间不起作用

sql-server - SSRS报告文件(.rdl)如何升级到最新?