Monday, December 28, 2009

Export of SSRS reports to PDF generates extra blank pages.


In Reporting Server you have the option to export your reports to PDF. This works fine however sometimes extra blank pages are generated. For instance, the reports is rendered on your screen on 3 pages. After exporting to a PDF file you got a file with 6 pages. After every printed page with content you goy an empty page. This is caused by the fact that the width size of the body of the report must be less or equal to the width size of the report minus the sum of the left and right margins.

 Retrieve the body properties of a report:
  • Enable the properties window. (In Visual Studio, View, Properties Window)
  • Click on the body of the report. The property window will now display the size of your body.  




Retrieve the report properties of a report:
Click on the gray area outside the report. The property window will now display the size of your report.




In this example the width size of the body is 19.7 cm. The report width is 21 cm. The left margin of the report is 0.635 cm and the right margin of the report is 0.635 cm. To avoid an extra printed pages in the exported PDF file next formula is used.

width size of the body + left margin of the report + right margin of the report <= report width
In this example: 19.7 + 0.635 + 0635 < 21
Yes that's the case because 20.97 <= 21

Enjoy exporting your SSRS reports to PDF.

7 comments:

Top Secret said...

Hey, thanks a lot. Helped a lot - simple and fast! :)

thirubalan said...

Good info.. My problem resolved.

John said...

fantastic thanks a lot

Hitesh Kachave said...

Hey Thanks...

senthil said...

Hey thanks ...

ankit singh said...

it really works

David McCabe said...

Brilliant thanks - saved a lot of head scratching!