Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get rid of blank pages in PDF exported from SSRS

People also ask

How do I stop blank pages in SSRS report?

Always keep the size of the elements less than that of the report width along with the margins from left and right. 2. Unnecessary Spaces: Avoid keeping unnecessary blank spaces in the report, Always keep the content intact with each other.

How do I delete a blank page in report Builder?

Choose File > Report Designer. Select the report to open it in the design grid. To delete a page break, select the column to the right of the page break and choose Insert > Remove Page break — or use one of the following methods to resize a column in the Report Designer.

How do I get rid of blank pages in Rdlc report PDF?

Just decrease the size of your RDLC report page, it will not add additional page in PDF.


In BIDS or SSDT-BI, do the following:

  1. Click on Report > Report Properties > Layout tab (Page Setup tab in SSDT-BI)
  2. Make a note of the values for Page width, Left margin, Right margin
  3. Close and go back to the design surface
  4. In the Properties window, select Body
  5. Click the + symbol to expand the Size node
  6. Make a note of the value for Width

To render in PDF correctly Body Width + Left margin + Right margin must be less than or equal to Page width. When you see blank pages being rendered it is almost always because the body width plus margins is greater than the page width.

Remember: (Body Width + Left margin + Right margin) <= (Page width)


Another thing to try is to set the report property called ConsumeContainerWhitespace to True (the default is false). That's how it got resolved for me.


After hours of struggling with this problem, I stumbled upon a solution that worked for me:

In SSDT (2012), I had originally had my Page Setup/Page units set to Centimeters. When I changed this to Inches, strangely enough, I was able to export my report to PDF without having every other page be blank.

enter image description here


It is better to do this on the design surface (Visual Studio 2012 is shown but can be done in other versions) first before calculating any maths when editing an SSRS document.

Below the following numbers in red circles that map to these following steps:

  1. In the design surface, sometimes the editor will create a page which is larger than the actual controls; hence the ghost area being printed.
  2. Resize to the controls. Visually look at the width/height and see if you can't bring in the page on the design surface to size it to the space actually needed by the controls and no more.
  3. Then try to create a PDF and see if that fixes it.
  4. If #3 does not resolve the issue, then there are controls requiring too much of the actual page size and going over in either length/width. So one will need to make the size of the controls smaller to accommodate a smaller page size.

Steps to manually remediate


Also in some circumstances one can just change a property of the report page by setting ConsumeContainerWhitespace to true to automatically consume the spaces.


The problem for me was that SSRS purposely treats your white space as if you intend it be honored:

enter image description here

As well as white space, make sure there is no right margin.