Solved

How to stop a single extra page at end of multi-page SSRS reports when exported to Word

Posted on 2013-12-11
5
4,147 Views
Last Modified: 2013-12-12
Hello Experts,

I am using SSRS 2008r2 in native mode, exporting to .DOC format and opening the resultant file in a mixture of Word 2007 and 2010. When the report fits on one page - even when almost full - one page is all I get, but when the content spills over onto a 2nd page I get 3 pages. Page 3 has nothing but the header and footer content.

I'm not getting alternate blank pages, so I haven't gone over the width boundaries. It isn't spilling over onto a 2nd page when a single page is almost full, so I haven't got surplus white space after my last object. Printing to preview / paper, plus export to PDF are fine.

As a matter of interest, I have set the report page to A4 Portrait with zero margins all round, but then put header, body and footer objects in rectangles located at 0in from top, 0.75in from left, with empty space above the topmost object in the header rectangle, and similar below the last object in the footer rectangle. Doing this gets around the issue of the Word renderer removing any blank space above the first and below the last object, then having stuff outside the printer's printable area. But, this issue was present before I rectified that.

The Word document has recognised A4 portrait, and the zero margins, and that aspect looks to work well with my simulated margins.

I am aware of TechNet Exporting to Microsft Word, particularly:
Repagination may cause page breaks to be inserted in locations where you did not intend to add them and, in some instances, may cause the exported report to have two successive page breaks in a row or add blank pages. You can try to change Word's pagination by adjusting the page margins.

But why the extra page, and why only when there is more than one page? How should the margins be adjusted to try to change the pagination, and is this what is happening here? Anyone know of any other workaround or things to check / try?

The object of export to Word is to allow users to add additional information in free text before printing. So, yes, they could remove the extra unwanted page, and modify all other page footers for the Page x of y, but they will gripe and point fingers at me :)

Help!

Regards and Thanks
Mark
0
Comment
Question by:SeeHearMark
  • 3
  • 2
5 Comments
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 39712751
I have no knowledge of your particular circumstance, but I have noticed, since Word 97, and perhaps earlier, that an extra blank page is sometimes produced,  especially following a table,

This is probably a problem with the printer driver, though this circumstance seems to catch out most of them.

It might help if we could seen an example, so could you please post a sample offending document.
0
 

Author Comment

by:SeeHearMark
ID: 39713518
Hi Graham,

Thanks for your response.

Here are two samples, edited to remove identifying information, although I have been VERY careful not to remove any markup. Note that, on the single page, the closing paragraph mark is immediately following the content of what was the SSRS Body, whereas on the multiple page sample, which should be 3 pages but comes out at 4, the closing paragraph mark is on the 4th page.

cheers
Certificate-of-Conformity-multip.doc
Certificate-of-Conformity-single.doc
0
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 500 total points
ID: 39713753
Yes, it's the mandatory final paragraph mark following a table that completely fills the otherwise last page,

If its font is set to Hidden and the option to print hidden text is turned off, the blank page shouldn't print.
0
 

Author Comment

by:SeeHearMark
ID: 39713778
Yep, that works a treat, including recalculating the page count. Thanks for that, and I will make sure you get a share of the points, as it is a reasonably simple task to advise the users to remove the surplus page this way.

Now all I need is for someone to tell me how I can get SSRS to not create it like this in the first place :) I'll leave the question open for 24 hours or so in the hope of someone out there not thinking we're on the way to a resolution, and request attention if nothing by then.

Regards,
Mark
0
 

Author Closing Comment

by:SeeHearMark
ID: 39713846
In fact, no need, as I found my own solution. I just added a rectangle after my tablix, flagged for new page before rectangle, then placed a text box inside it that says "This page intentionally left blank for notes". Because Word then has some actual text after the table SSRS builds, it handles the page breaks properly.

It might not suit all situations, but its fine with us :)

Can I share the points with myself???? Only joking, but have marked as Good rather than Excellent, as it is only a partial solution.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Written by Valentino Vranken. Introduction: The first step of creating a SQL Server Reporting Services (SSRS) report involves setting up a connection to the data source and programming a dataset to retrieve data from that data source.  The data…
Introduction This tutorial provides instructions on how to properly format your Word document using the inbuilt tools provided. The benefits of using these tools means your documents are more accessible and easily portable to other applications an…
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now