10
votes

I have a report created in SSRS 2008 that I call from and display in an asp page using the ReportViewer Control. In the ReportViewer my report has an extra/blank page at the end, but when I export it to PDF my report is perfect!. Nothing gets off the page, margins and size are all fine, under 10.0 in for a landscape report. Any idea what could be causing this?

9
It could be your web browser formatting the report incorrectly. I've seen some SSRS reports show up with different formatting between browsers.Colin
The same issue shows up using IE7, IE8, and Firefox 3.5.Monica

9 Answers

19
votes

Short Answer: Try shrinking the vertical size of the Body so there is no whitespace below the last page item.

Long Answer: I had the opposite problem when using reportviewer to render a 1-page form letter. Reportviewer rendered it correctly (one page) in the browser, but the exported PDF added a blank page 2. The Body size in my .rdlc file was exactly 8.5 x 11 in. so I could see the margins. Shrinking the vertical size of the Body to remove the whitespace below the last item (9.8" in my case) fixed the problem. (The exported PDF still has a page size of 8.5x11.)

(Thanks jimconstable. I don't yet have the "reputation" to vote for answers.)

7
votes

Is the report surface larger than the page? That will cause an extra page that might not be there in a pdf.

7
votes

This is usually caused because some of your page items... text boxes, rectangles, lines, tables... fall outside of the margins. I usually work on rather complex reports and what I have to do is put boarders (with different colors) on each thing that has an edge near the right hand of the page.... then when you preview, you can tell by the colors which thing is overflowing. Then you can re-size the objects or the margins until nothing overflows and the extra page is gone.

This actually happens a lot with sub-reports. They can push over textboxes, rectangles, lines... anything... that are placed to the right of them.

This can be an incredibly frustrating problem but I highly suggest adding colored borders to your report objects until you find what is spilling over. Sometimes - it can even be the canGrow property or it can be just white space left below your lowest report object so be sure to drag the bottom of the report body almost all the way up to the lowest object on your report (sometimes if the report body touches the lowest item that item's content can be cut off though, I always leave a little space, about the height of one of these letter's I am typing)

5
votes

I've been having a similar problem (though there was also a blank page in the exported .pdf for me), which I eventually solved by doing the following:

  • Opened up the .rdl file in my text editor of choice
  • Searched for <Width> / <xxxWidth> tags, and reduced all the values contained between these tags to be less than the value minus the width of the margins on each side.

For me, the problem width belonged to the top level <Report> element, and changing it didn't affect the appearance of the report.

Of course, the next thing to try would be doing the same with <Height> tags.

2
votes

There is a confusion there on the page design. Developers would think the report being designed is WYSIWYG, but actually it's NOT!! Microsoft reportviewer will take your designed page as the content!! and append the margins defined on the outside of your page, and turn out that your page can never fit in to one page!!

So, when you design a new report, focus on the content area, the client area, including your headers and footers, and allow margins to be appended on your outer border.

2
votes

I had the same problem with a very simple report. My solution was in the Report Properties\Margins, set all the margins (left, top, right, bottom) to zero. That shrinks the report width and height. Apparently the margins are outside of the page size, usually (8.5 x 11 in).

I hope this solve the problem.

2
votes

I also got the blank page at the end of report, but it disappeared in PDF. And I found that, if we uncheck the option "Add page break after", the blank page will not appear in SSRS. But When we export to PDF, there are no page break in PDF.

1
votes

I've found that removing the Column Group for a detail report solved the problem. Nothing else worked. I made sure the Body fit within the Page size, made sure there was nothing extending into a margin in the Header or Footer. I didn't need column grouping and the output was the same without it. It seems to be necessary when using the Report Designer but isn't necessarily needed for the resulting report.

0
votes

You have to check that the width of the bofy in the "Body properties" tab is not higher that the width of the page in the "Report properties" tab, otherwise the last part of the body renders in another page. A4 size is 21cm x 29,7cm and make sure to consider the margins to calculate the max body size.