是否可以使用报告参数设置 SSRS 报告的页面布局?

发布于 2024-08-08 19:44:28 字数 282 浏览 1 评论 0原文

我正在使用 SSRS 在我的应用程序中生成报告。我的应用程序在幕后调用 Web 服务。在某些情况下,我使用 ReportViewer Web 控件呈现报告,在其他情况下(例如,如果用户使用基于 Webkit 的浏览器),我只允许他们下载报告的 pdf 格式。我以编程方式设置报告参数。

如何让用户能够决定页面布局(边距、横向/纵向、纸张尺寸)?有没有办法使用报告参数配置报告布局?

在 Letter 和 Legal 之间进行选择的能力是我的主要兴趣。

另一种方法是为每个报告构建两个版本,但我讨厌重复。

I'm using SSRS to generate reports in my app. My app calls the web service behind the scenes. In some cases I render the report using the ReportViewer web control, in other cases (if user is using Webkit based browser for example), I just allow them to download a pdf of the report. I set the report parameters programatically.

How can I give my users the ability to decide on the layout of the page (margins, landscape/portrait, paper size)? Is there someway to configure the report layout using report params?

The ability to choose between Letter and Legal is my main interest.

Alternative is to build 2 version of each report but I hate repetition.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

作死小能手 2024-08-15 19:44:28

据我所知,如果您正在使用 ReportViewer,请按以下步骤操作:

reportViewer.SetPageSettings(new PageSettings()
{
  Landscape = false,
  Margins = new Margins()
  {
    Left = 1,
    Top = 1,
    Right = 1,
    Bottom = 1,
  },
  PaperSize = new PaperSize()
  {
    Height = 1100,
    Width = 850,
    RawKind = (int)PaperKind.Letter,
  }
});

希望这会有所帮助..

As far as I know, if your are using the ReportViewer here's how to do it:

reportViewer.SetPageSettings(new PageSettings()
{
  Landscape = false,
  Margins = new Margins()
  {
    Left = 1,
    Top = 1,
    Right = 1,
    Bottom = 1,
  },
  PaperSize = new PaperSize()
  {
    Height = 1100,
    Width = 850,
    RawKind = (int)PaperKind.Letter,
  }
});

Hope this helps..

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文