Exporting PDF in Reporting Services

☆樱花仙子☆ 提交于 2020-01-02 04:33:13

问题


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?

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.

Thanks


回答1:


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

Here is the possible DeviceInfo data for a PDF render:

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

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


来源:https://stackoverflow.com/questions/838937/exporting-pdf-in-reporting-services

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!