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.

17 comments:

HiperiX said...

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

thirubalan said...

Good info.. My problem resolved.

John said...

fantastic thanks a lot

Unknown said...

Hey Thanks...

senthil said...

Hey thanks ...

Unknown said...

it really works

Unknown said...

Brilliant thanks - saved a lot of head scratching!

Unknown said...

Great info! Was pulling my hair out trying to figure out where the extra pages were coming from!

Anonymous said...

thank you thank you thank you thank you!!!!!!!!!!!!!!!!!!

edwin said...

This is a nice tip.Thank you so much! Was wondering how the extra pages were added in the PDF.

ReddyK said...

it worked thank you

Unknown said...

Really helpful.....thanks a...lot

liamred said...

gracias!!

Sukhveer said...

wow, great concept. thanks

Girisha K said...

WOW. Finally worked.

Unknown said...

Wow. Thats great!! Solved my issue.

Unknown said...

Thank you so much! you are the only one who hit the nail on the head.