Solved

RDLC PDF Paging Issues

Posted on 2011-02-14
8
5,300 Views
Last Modified: 2016-09-12
Experts,

I have an RDLC report that I am using to generate PDF letters from a database.  Each letter (each record in the data source) should be on its own page, but may span multiple pages if necessary.  Basically, I have three fields that I use to generate each letter: AddressBlock, LetterDate, and BodyText.  The PDF file is generated from a windows app using the Microsoft.Reporting.WinForms.ReportViewer class.

I have used the below RDLC layout to generate the letters.  I just have a static header and footer, and one list in the body that contains three bound text boxes.

 Report Design
Everything has worked fine until I discovered that if the BodyText text box gets to be just the right size it will go off on to its own page, leaving the AddressBlock and LetterDate text boxes on the first page.  This does not happen if the contents are smaller (the letter is generated as just a single page), or if the contents are larger (the letter begins on the first page and spans across multiple pages).  In this perfect storm scenario, the contents of the BodyText text box are just long enough to warrant spanning to another page, but instead of the text box beginning on the first page and slightly spanning onto the second, the whole text box moves to the second page, and only the AddressBlock text box and the LetterDate text box are on the first page, with a bunch of white space below.


It is supposed to look like this (if the body can fit on one page):  Example 1-Page Letter

Or this (if the body is longer than what can fit on one page):  Example 2-Page Letter


but instead looks like this (incorrect):  Incorrect 2-Page Letter

I hope this is just something stupid, as I do not have a whole lot of reporting experience.  It has been driving me nuts for days...

Thanks,
Grant
0
Comment
Question by:gtporter
  • 4
  • 3
8 Comments
 
LVL 18

Accepted Solution

by:
chrismc earned 500 total points
ID: 34894748
Assuming this is SSRS 2005, then this is a particular weakness of it!

You have one cell that can get very large. SSRS will do everything to try and keep that object together on a page.

There are some "Keep Together" properties on various objects in SSRS. You could experiment with that but I've found it a bit hit and miss.

You are probably better off trying to break that "Body Text" down into smaller pieces in your data query then displaying it inside a nested list box.
0
 

Author Comment

by:gtporter
ID: 34896913
Thanks for your response.  As this is a client-side RDL file (not SSRS-hosted), and I am using the WinForms ReportViewer class, I can use whatever version I choose, as far as I know.  This was developed using VS2008, but I do have VS2010 and ReportBuilder 3.0 at my disposal if newer versions would not have this issue.  Splitting the body up did come to mind, but that would mean changing a bunch of code and including logic on where to split cleanly, etc.  I would rather fix this at the report definition level.

Thanks,
Grant
0
 
LVL 18

Expert Comment

by:chrismc
ID: 34898275
Hi Grant
The later versions are supposed to perform a lot better. But I haven't used them in earnest so can't add any useful comment on that.
I understand your dilemma on splitting the data but if you have to go down that route I'd suggest splitting on paragraph breaks.

Cheers
Chris
0
 

Author Comment

by:gtporter
ID: 34898800
I just tried VS2010.  Same story...  The version of the Microsoft.ReportViewer.WinForms DLL was 10.0.0.0 (runtime v2.0.50727).  Is this the latest version available?  I'm trying to avoid breaking up the string at all costs, but it's sounding more and more like that will be the only option.  I hate band-aids...

Thanks,
Grant
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 18

Expert Comment

by:chrismc
ID: 34898967
I know what you mean but on the flip side SSRS is a data reporting tool and not designed to be a word processor which is kind of what you are trying to do.
Not a criticism but if you look at it from that point of view it's more understandable.

I have reports that generate contract letters and I had to do the breakdown to make it format properly so I do feel your pain.

Cheers
Chris
0
 

Author Comment

by:gtporter
ID: 34899241
Oh, I hear you...  I was originally going to go with some sort of MS Word mail merge, but I determined that using a report would be more automated and easier on the end-users (we wouldn't have to teach them how to do a data-bound mail merge in Word).  I think I'll close this, as it seems like an easy solution was a pipe dream.  Thanks for your help.
0
 

Author Closing Comment

by:gtporter
ID: 34899267
While not the solution I was looking for, it did solve the problem.
0
 

Expert Comment

by:urvi chauhan
ID: 41793947
i have create page but when i convert report to pdf some text are missing in pdf
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
It is helpful to note: This is a cosmetic update and is not required, but should help your reports look better for your boss.  This issue has manifested itself in SSRS version 3.0 is where I have seen this behavior in.  And this behavior is only see…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

707 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

15 Experts available now in Live!

Get 1:1 Help Now