【问题标题】:Sending custom HTTP headers with an SSRS Rendering Extension使用 SSRS 渲染扩展发送自定义 HTTP 标头
【发布时间】:2019-10-31 19:08:24
【问题描述】:

SSRS 渲染存在一个已知问题,即在渲染 PDF 时会发送 Content-Disposition: attachment; ... 标头,这会强制文件下载而不是内联打开 (here's an SO thread about it from 2009)。

我想知道是否可以通过在 SSRS 中使用 Rendering Extension 在浏览器中打开 PDF。我在 C# 中找到了一个示例渲染扩展,在这里: https://blogs.technet.microsoft.com/johannh/2017/07/14/creating-and-debugging-a-ssrs-custom-rendering-extension/

但是,该代码似乎只输出一个流。是否可以在发送流之前以某种方式发送标头,从而覆盖通常发送的 Content-Disposition 标头?

【问题讨论】:

    标签: c# reporting-services ssrs-2017


    【解决方案1】:

    我收到了 Microsoft 的一位 SSRS 工程师对 Microsoft 工单的回复,他确认 SSRS 本身会发送 Content-Disposition 标头,因为它不打算用于提供数据,因此渲染扩展不能更改标题。

    SSRS 工程师建议的解决方案是:

    • 使用自定义应用程序在渲染后去除页眉并为用户提供 PDF
    • 生成静态 PDF 后将其引导至静态 PDF

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-11-26
      • 1970-01-01
      • 2016-05-27
      • 1970-01-01
      • 2014-03-08
      相关资源
      最近更新 更多