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

I have a two-page SSRS report. When I exported it to PDF it was taking 4 pages due to its width, where the 2nd and 4th pages were displaying one of my fields from the table. I tried to set the layout size in report properties as width=18in and height =8.5in. It gave me the whole table in a single page of PDF, but I am still getting the 2nd and 4th pages blank. Is the way I am doing it incorrect? How else can I get rid of those blank pages?

19 6 6 bronze badges asked Dec 12, 2008 at 14:27 brijit brijit

17 Answers 17

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)

answered Dec 18, 2008 at 2:08 Nathan Griffiths Nathan Griffiths 12.7k 2 2 gold badges 36 36 silver badges 54 54 bronze badges

Doesn't work. My body width is less than "Report width - margins". And still I have a ton of blank pages in there.

Commented Apr 12, 2010 at 8:06

@adolfgarlic I've found that the page width settings don't always work correctly under report properties. Have you tried manually dragging the report width in Visual Studio? That resolved this issue for me today after banging my head against the wall for a good while. Would be worth checking your header / footer widths also, they might be slightly too large.

Commented Jan 11, 2012 at 5:40

I found that the rule that worked here was not (Body Width + Left margin + Right margin) Commented Mar 14, 2012 at 0:57

Also another thing to note is the height of the header + body + footer + top + bottom margin < Page Height else the page is going to flow in multiple pages.

Commented Sep 9, 2014 at 13:53

When you create a report for the first time, the builder runs a white area (the "Body" that Nathan mentions) across the width of the screen to put stuff on. Typically, this white area is 17 inches wide on a newer letterbox screen. What isn't intuitively obvious is that this is considered a printable object, and needs to be narrowed to the width of the stuff you put on it. If you don't do this, you'll get blank pages, no matter all the other stuff that everyone mentions.

Commented Dec 30, 2014 at 15:07

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.

31k 12 12 gold badges 105 105 silver badges 132 132 bronze badges answered Jul 17, 2013 at 21:57 4,210 2 2 gold badges 22 22 silver badges 23 23 bronze badges

Yep, worked for me too. I have a container with a tablix with column groups. Clearly the container was growing to contain the column groups and without consuming the container's white space it would overflow the page boundary.

Commented Jan 21, 2014 at 14:36

This was certainly the key for me. I always utilize the accepted answer by Nathan, with mixed results. In each case where Nathan's solution did not solve the problem, this one did the trick. Be aware that you still should utilize what Nathan suggests.

Commented Feb 21, 2014 at 13:58

YES x100! It's too bad you can't have 2 "accepted answers", because it seems like the proper course is a combo of both this and the accepted one. Kudos to you!

Commented Aug 31, 2016 at 18:55 I am using VS 2017 SSRS, do not see this property. Commented Apr 18, 2017 at 17:07

Whoops, take it back. I am using VS 2017 SSRS/SSDT; took me a while to figure out you have to use Properties window to find this feature, not the Report Properties. dialog.

Commented Apr 18, 2017 at 17:15

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

answered Dec 5, 2012 at 18:14 3,111 8 8 gold badges 41 41 silver badges 68 68 bronze badges

This worked for me perfectly. Changing inches to Cm will work or vice versa, but there is no need to stick on the Cm. One more thing is, need to set margins for at-least 1cm then the report is generating without additional empty page.

Commented Feb 19, 2017 at 7:24

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

answered Jan 26, 2015 at 15:03 31k 12 12 gold badges 105 105 silver badges 132 132 bronze badges

Thankyou! I knew it had to be simpler than going through numbers and doing math. I wasn't aware that it was printing whitepace just because the report body was that large.

Commented Apr 15, 2015 at 13:52

Setting ConsumeContainerWhitespace to true did it for me. I had already cleaned up my report, body, and table widths though

Commented Aug 16, 2017 at 17:29

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.

answered Jun 16, 2015 at 3:47 Jeremy Thompson Jeremy Thompson 64.7k 37 37 gold badges 213 213 silver badges 335 335 bronze badges Hi @jeremy-thompson, your tip happens to be very handy. Cheers Commented Mar 22, 2016 at 9:30

Removing the right margin worked for me and didn't affect rendering in either web report viewer or PDF.

Commented Jan 9, 2017 at 1:27 5 years later, this was the one for me. Commented May 6, 2020 at 15:10

If the pages are blank coming from SSRS, you need to tweak your report layout. This will be far more efficient than running the output through and post process to repair the side effects of a layout problem.

SSRS is very finicky when it comes to pushing the boundaries of the margins. It is easy to accidentally widen/lengthen the report just by adjusting text box or other control on the report. Check the width and height property of the report surface carefully and squeeze them as much as possible. Watch out for large headers and footers.

answered Dec 12, 2008 at 16:09 6,123 4 4 gold badges 25 25 silver badges 24 24 bronze badges

Have you tried to see if there is any white space on the right of your report? If so you can drag it back to the end of your report and then drag the report background back to the same spot.

answered Jul 16, 2013 at 23:24 user2585349 user2585349 81 1 1 silver badge 1 1 bronze badge

I have worked with SSRS for over 10 years and the answers above are the go to answers. BUT. If nothing works, and you are completely stuffed. remove items from the report until the problem goes away. Once you have identified which row or report item is causing the problem, put it inside a rectangle container. That's it. Has helped us many many times! Extra pages are mostly caused by report items flowing over the right margin. When all else fails, putting things inside a rectangle or an empty rectangle to the right of an item, can stop this from happening. Good luck out there!

answered Jun 17, 2016 at 10:43 121 2 2 silver badges 8 8 bronze badges

Its worked for me.by adding extra empty column into table, my report in pdf format doesn't show the extra blank pages.

Commented Jun 20, 2016 at 11:45

In addition to the margins, the most common issue by far, I have also seen two additional possibilities:

  1. Using + to concatenate text. You should use & instead.
  2. Text overflowing the width of the specified textbox. So if your textbox only holds 30 characters and you try to cram 300 in there, you might end up with extra pages.
answered Apr 10, 2012 at 21:13 Joshua Drake Joshua Drake 2,738 3 3 gold badges 36 36 silver badges 55 55 bronze badges

enter image description here

On the properties tab of the report (myReport.rdlc), change the "Keep Together" attribute to False. I've been struggling with this issue for a while and this seems to have solved my issue.

answered Dec 18, 2014 at 19:28 129 3 3 silver badges 12 12 bronze badges

I recently inherited a report that I needed to make a few changes. After following all the recommendations above, it did not help. The report historically had this extra page, and nobody could figure out why.

I right clicked on the tablix and selected properties. There was a checkbox checked that said add a page break after. After removing this, it prints on one page now.

enter image description here

answered Jan 29, 2018 at 15:41 824 18 18 silver badges 34 34 bronze badges

I fixed this issue by doing the following. ( Using the latest version of Report Builder )

Step 1.) Go to View Tab
Step 2.) Check the Properties checkbox enter image description here
Step 3.) Click inside the body of your report (it will update values in properties tab) enter image description here
Step 4.) Take not of the width here
Step 5.) Right click in the gray area outside the report and click report properties enter image description here
Step 6.) Add your left + right margin to your body width ( if that equals 10 then make your width 11) enter image description here
Step 7.) Save

answered Jun 22, 2021 at 13:36 117 5 5 bronze badges

Can you explain how your math adds up? 9.06476 + 0 + 0 != 9.2, 8.42861 + 0.5 + 0.5 != 11.69. And in Step 6, what do you mean by "if that equals 10 then make your width 11"? Do you mean to take left + right + 1 ?

Commented Oct 22, 2021 at 18:23

If your report includes a subreport, the width of the subreport could push the boundaries of the body if subreport and hierarchy are allowed to grow. I had a similar problem arise with a subreport that could be placed in a cell (spanning 2 columns). It looked like the span could contain it in the designer and it rendered fine in a winform or a browser and, originally, it could generate printer output (or pdf file) without spilling over onto excess pages.
Then, after changing some other column widths (and without exceeding the body width plus margins), the winform and browser renderings looked still looked fine but when the output (printer or pdf) was generated, it grew past the margins and wrote the right side of each page as a 2nd (4th, etc.) page. I could eliminate my problem by increasing colspan where the subreport was placed.
Whether or not you're using subreports, if you have page spillover and your body design fits within the margins of the page, look for something allowed to grow that pushes the width of the body out.

answered Mar 20, 2017 at 21:57 Bill1260231 Bill1260231 33 4 4 bronze badges

Make sure the designer in visual studio is not going beyond your max width. Hover over the right page border and drag to the left to make sure the page does not go over your desired layout.

enter image description here

answered Mar 25, 2021 at 16:04 1,689 1 1 gold badge 18 18 silver badges 26 26 bronze badges

This has solved my issue. At the right side I had to much white and empty part. By removing it solved my problem.

Commented Aug 11, 2021 at 8:19

I just reduced all elements Width shorter than 8 inch and it is being corrected, I did that with mouse, your report Body should be shorter than 8 inch.

2,922 4 4 gold badges 30 30 silver badges 45 45 bronze badges answered Dec 7, 2021 at 13:07 11 1 1 bronze badge

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.

Commented Dec 7, 2021 at 13:43

I hope from above all explanations the issue might get resolved But I want to add my point of view here.

You need to check all the spaces after the items such as rectangle, matrix or table and try minimize it. And the 2nd way is if still you're getting more pages then try to reduce the gap between the items present in your report. It works for me in this way.

answered Jul 31, 2023 at 6:21 Sonali Choudhury Sonali Choudhury 1 4 4 bronze badges

I've successfully used pdftk to remove pages I didn't want/need in pdfs. You can download the program here

You might try something like the following. Taken from here under examples

Remove 'page 13' from in1.pdf to create out1.pdf pdftk in.pdf cat 1-12 14-end output out1.pdf

pdftk A=in1.pdf cat A1-12 A14-end output out1.pdf

answered Dec 12, 2008 at 15:03 2,870 5 5 gold badges 23 23 silver badges 30 30 bronze badges

Linked

Related

Hot Network Questions

Subscribe to RSS

Question feed

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

Site design / logo © 2024 Stack Exchange Inc; user contributions licensed under CC BY-SA . rev 2024.9.2.14718