vrijdag 16 december 2011

Export SCOM 2007 R2 SQL reports in PDF Landscape

When using reporting in SCOM 2007R2 sometimes reports don't get out right.
In pages with graphs the first part of the graph is on the first page and the rest of the report is on the second page.
First page:
Second page:

When you save them as PDF it look real messy and you need double the pages if you print.

It is possible to create two extra choices in the export menu, one for creating a A4 PDF portrait report and one for A4 PDF Landschape.

In my case, I use SQL 2008 R2.
To create the export options, follow these steps:

Log on to the SCOM reporting server.
Locate the Rsreportingserver.config file ( C:\Program Files\Microsoft SQL Server\{instance}\Reporting Services\ReportServer )
Open Rsreportingserver.config file in notepad.
Create a copy from the file before continuing. ( for backup )
Locate the "Render" section in the file :


Paste the following below the "Extension Name="PDF" "

<Extension Name="PDF (A4 Landscape)" Type="Microsoft.ReportingServices.Rendering.ImageRenderer.PDFRenderer,Microsoft.ReportingServices.ImageRendering">
        <OverrideNames>
            <Name Language="en-US">PDF in A4 Landscape</Name>
        </OverrideNames>
        <Configuration>
            <DeviceInfo>
                <OutputFormat>PDF</OutputFormat>
                <PageHeight>8.27in</PageHeight>
                <PageWidth>11.69in</PageWidth>
            </DeviceInfo>
        </Configuration>
</Extension>
<Extension Name="PDF (A4 Portrait)" Type="Microsoft.ReportingServices.Rendering.ImageRenderer.PDFRenderer,Microsoft.ReportingServices.ImageRendering">
        <OverrideNames>
            <Name Language="en-US">PDF in A4 Portrait</Name>
        </OverrideNames>
        <Configuration>
            <DeviceInfo>
                <OutputFormat>PDF</OutputFormat>
                <PageHeight>11.69in</PageHeight>
                <PageWidth>8.27in</PageWidth>
            </DeviceInfo>
        </Configuration>
</Extension>

If desired, you can even enter a custom PageHeight and PageWidth for your export.
Now run IISreset from the command line on the SCOM reporting server.
( Note : If reporting is co-hosted, only do a reset of reporting to prevent downtime of other sites )

Now open SCOM reporting and notice two extra options in the export menu, using PDF as output with the margins provides in the config file.


Now you're done! No more messy reports!

1 opmerking:

  1. Thanks, for this beautifull solution. This also solves the issue with blank pages.

    BeantwoordenVerwijderen