Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exporting PDF in Reporting Services

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

like image 395
Phil Avatar asked May 08 '09 09:05

Phil


People also ask

How do I export a report to PDF?

In Desktop, select File > Export > Export to PDF. Report pages that are currently not visible, such as any tooltips or hidden pages, are not exported to the PDF file. While the export is being processed, a dialog appears that lets you know that the export process is underway.

How do I automatically export SSRS to PDF?

Under “Render Format”, choose PDF. 7.) Then simply select your schedule – if you choose daily at 8am, for example, SSRS will automatically export the file to your specified location at 8am each day.

How do I remove PDF option from export options in SSRS report?

Disable the PDF export option - add the visible attribute with value false . Enable the PDF export option - remove the visible attribute.


1 Answers

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
like image 158
jgallant Avatar answered Sep 22 '22 08:09

jgallant