views:

922

answers:

1

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

+2  A: 

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
Jon