counter hit make
Export SQL reports in PDF landscape - scom

System Center Operations Manager

Blog about SCOM 2007 aka Opsmgr

Recent Posts

Tags

News

Community

Email Notifications

Blogs

Links

Archives

Export SQL reports in PDF landscape

I had to create some reports for a customer this week and the layout of the report didn’t satisfied my client. The reports are exported in portrait format and not in landscape format.

 

First part of the report

image

and on the second page I got the rest of my report.

image

 

Very ugly……….

 

How to export a scom report in pdf landscape format?

 Only solution here is to render the pdf in landscape format, so I start googling and found this blog http://www.bictt.com/blogs/bictt.php/2009/03/17/sql-reporting-services-render-pdf-in-a4-1  and also some information msdn http://msdn.microsoft.com/en-us/library/ms156281.aspx 

 

So to resolve our problem we have to add some code in the Rsreportserver.config file that you can find under “Program Files\Microsoft SQL Server\MSSQL.5\Reporting Services\ReportServer\”

 

You can specify rendering extension parameters in the RSReportServer configuration file to override default report rendering behavior for reports that run on a Reporting Services report server. You can modify rendering extension parameters to achieve the following objectives:

  • Change how the rendering extension name appears in the Export list of the report toolbar (for example, to change "Web archive" to "MHTML"), or localize the name to a different language.
  • Create multiple instances of the same rendering extension to support different report presentation options (for example, a portrait and landscape mode version of the Image rendering extension).
  • Change the default rendering extension parameters to use different values (for example, the Image rendering extension uses TIFF as the default output format; you can modify the extension parameters to use EMF instead).

 

Locate the render section in the rsreportserver.config file

 Capture

 

We are going to add two extra entries to the export list.

Below the pdf entry paste the following code:

<Extension Name="PDF (A4 Landscape)" Type="Microsoft.ReportingServices.Rendering.ImageRenderer.PdfReport,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.PdfReport,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>

Save the file and close it. I also did a IIsreset and a restart of my sql reporting services just to be sure.

When I want to export a report I have two extra entries:

image

 

Now when I want to export a report in landscape format I just choose to export in pdf in A4 landscape format and this is the result:

image

 

Everything perfectly fits on one page and I have a happy client now :-) !!  Thanks to Bob Cornelissen for his blog.

 

Hope this helps,

Alexandre Verkinderen

Comments

SCUG at myITforum.com said:

I had to create some reports for a customer this week and the layout of the report didn’t satisfied

# September 27, 2009 3:14 AM

lariza6 said:

On SQL 2008 I've changed the parameter "PdfReport" with "PDFrenderer" and now it's working.

<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>

Thanks.

Lara

# November 4, 2009 10:40 AM

alkin said:

Thanks For the info Lara!

# November 4, 2009 9:43 PM

lariza6 said:

Only for who need to change even the paper margins.

<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>

<MarginBottom>0.2in</MarginBottom>

<MarginLeft>0.2in</MarginLeft>

<MarginRight>0.2in</MarginRight>

<MarginTop>0.2in</MarginTop>

           </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>8.27in</PageHeight>

               <PageWidth>11.69in</PageWidth>

<MarginBottom>0.2in</MarginBottom>

<MarginLeft>0.2in</MarginLeft>

<MarginRight>0.2in</MarginRight>

<MarginTop>0.2in</MarginTop>

   </DeviceInfo>

       </Configuration>

</Extension>

# November 11, 2009 10:43 AM

Wberg said:

Lara - Thank You, margin issue here, solved.

# December 2, 2010 11:44 AM