在 Reporting Services 中导出 PDF [英] Exporting PDF in Reporting Services

查看:47
本文介绍了在 Reporting Services 中导出 PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道在导出后以 PDF 格式显示时是否可以更改报告的页面大小/比例?

Does anyone know if it is possible to alter the page size/scale of a report when it is displayed in PDF after an export?

我们遇到的问题是,我们的一个用户创建了一个包含大量表格列的报告,然后该表格会运行到报告的下一页.我们已在 Business Intelligence Studio 中将页面设置更改为横向,然后以 PDF 横向呈现报告.但是,当我将页面设置更改为 A3 时,这并不能解决问题.是否可以通过这种方式调整大小/缩放比例,或者是否有我不知道的更好的方法.

The problem we have is one of our users has created a report with a large number of coloumns in the table, the table then runs on to the next page of the report. We have altered the page setup to landscape within the Business Intelligence Studio which then renders the report in landscape in PDF. However when I changed the page settings to A3 this doesn't solve the issue. Is it possible to resize/scale this way or is there a better method I am not aware of.

谢谢

推荐答案

是的.您需要手动导出,并在渲染过程中指定设备信息.

Yes. You need to do a manual export, and specify Device Information during the rendering.

以下是 PDF 渲染的可能 DeviceInfo 数据:

Here is the possible DeviceInfo data for a PDF render:

http://msdn.microsoft.com/en-us/library/ms154682.aspx

现在,导出为 PDF 的方法将是这样完成的:

Now, the export to PDF method will be done like this:

  Private Sub ReportCommandExportToPDF()
    Dim warnings As Warning() = Nothing
    Dim streamids As String() = Nothing
    Dim mimeType As String = Nothing
    Dim encoding As String = Nothing
    Dim extension As String = Nothing
    Dim bytes As Byte()
    Dim deviceInf as String = Nothing

    deviceInf = "<DeviceInfo><MarginLeft>0.2</MarginLeft></DeviceInfo>"

    bytes = ReportViewer1.LocalReport.Render("PDF", deviceInf, mimeType, encoding, extension, streamids, warnings)
      Dim fs As New FileStream("File.pdf", FileMode.Create)
      fs.Write(bytes, 0, bytes.Length)
      fs.Close()

  End Sub

这篇关于在 Reporting Services 中导出 PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆