Link to home
Start Free TrialLog in
Avatar of gtporter
gtporter

asked on

RDLC PDF Paging Issues

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.

 User generated image
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):  User generated image

Or this (if the body is longer than what can fit on one page):  User generated image


but instead looks like this (incorrect):  User generated image

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
ASKER CERTIFIED SOLUTION
Avatar of Chris McGuigan
Chris McGuigan
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gtporter
gtporter

ASKER

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
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
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
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
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.
While not the solution I was looking for, it did solve the problem.
i have create page but when i convert report to pdf some text are missing in pdf