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.

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

koe61831 said...

Visual Studio is a game-changer for developers! Its intuitive interface, robust debugging tools, and seamless integration with various languages make coding a breeze. The extensive library of extensions further enhances productivity, while regular updates ensure staying on the cutting edge. Whether you're a beginner or a seasoned pro, Visual Studio's user-friendly features and powerful capabilities create a seamless coding experience. It's a must-have tool that simplifies development, fostering creativity and efficiency in every project.

Whome1996 said...

Hey everyone, I've been exploring ways to optimize Reporting Server reports, and I came across an excellent resource on incorporating SSD technology to boost performance (ssd images). The insights shared in this article shed light on how SSDs can significantly enhance data retrieval and processing speed. Considering the discussion around report exports in this thread, integrating SSDs might offer a valuable solution to expedite the reporting process. Has anyone experimented with SSDs in this context? I'd love to hear your experiences and insights!