【问题标题】:How to create pdf programatically from microsoft report (.rdl) in Landscape?如何从 Microsoft 报告 (.rdl) 中以编程方式创建 pdf?
【发布时间】:2014-03-10 17:41:22
【问题描述】:

我正在使用 Microsoft 报表 (.rdl),我已在报表属性中将其布局更改为横向。它在报表查看器中显示横向,但是当我通过报表查看器或以编程方式将其保存为 pdf 时,它没有在横向中保存 pdf。它以纵向保存 pdf 并将一页报告呈现到多页。

【问题讨论】:

    标签: c# reporting-services report reportviewer


    【解决方案1】:

    您确定您的报告大小正确以适合横向页面尺寸吗?查看此问题的答案,了解有关 PDF 格式的一些提示:

    How to get rid of blank pages in PDF exported from SSRS

    【讨论】:

      【解决方案2】:

      您所要做的就是在报告属性中交替报告宽度和高度。如果你想要它在 A4 纸上,那么给定 width=29cm 和 height=21cm。

      来源:http://forums.devarticles.com/microsoft-sql-server-5/reporting-services-export-pdf-in-landscape-9209.html

      【讨论】:

        【解决方案3】:

        您还可以在 DeviceInfo 设置中修改 PageHeight 和 PageWidth。

        例子:

        string deviceInfo =
                    "<DeviceInfo>" +
                    "  <OutputFormat>PDF</OutputFormat>";
                if (!landscape)
                { // display report in portrait
                    deviceInfo +=
                    "  <PageWidth>8.5in</PageWidth>" +
                    "  <PageHeight>11in</PageHeight>";
                }
                else // display report in Landscape
                {
                    deviceInfo +=
                    "  <PageWidth>16in</PageWidth>" +
                    "  <PageHeight>8.5in</PageHeight>";
                }
                deviceInfo +=
                    "  <MarginTop>0.5in</MarginTop>" +
                    "  <MarginLeft>0.5in</MarginLeft>" +
                    "  <MarginRight>0.5in</MarginRight>" +
                    "  <MarginBottom>0.5in</MarginBottom>" +
                    "</DeviceInfo>";
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多