Home
Analytics
Total page count of pdf report in Birt design
BirtUser79
I have requirement where Pdf report should have extra blank page as last page if total page count is odd.
Report is in Birt 2.6.2 and uses RunAndRendor task.
I know we can do this using PdfReader API which can used once Pdf is generated. But can some one help me if and how we can do this in Birt design itself. I was wondering if we can add some text or label control on Birt design file with message like 'blank page' and can add visibility condition based upon total number of pages and then we could set page break property so that it will appear on new page.
Thanks in advance.
Find more posts tagged with
Comments
BirtUser79
Any help on this ?
mwilliams
Take a look at this report. You should just need to move the text box outside the table to avoid the header.
BirtUser79
Thank you for sample design file.
I tried this approach, but it didnt work.
I set below script for onCreate() event for text box..
if (pageNumber%2 != 0){
this.getStyle().pageBreakBefore = "always"
}
For both odd and even pages Pdf output, it didn't add page break.
Please let me know if I am missing something? Don't we need to define/populate pageNumber somewhere?
mwilliams
Can you recreate your issue with the sample database and attach the report, in here?
BirtUser79
Using sample db, Pdf was generated with even pages. But when I used the script in my report Pdf was generated with odd pages only.
mwilliams
Can you attach your design?
BirtUser79
Michael, I can not attach my design file here. Please let me know if there is some other way I can assist so this issue gets resolved.
mwilliams
Can you send it to me in an email? mwilliams@actuate.com
BirtUser79
Sorry but it is company confidential design so afraid to send it across.
mwilliams
I'll sign a confidentiality agreement, if that allows you to send it. Otherwise, if you can create a report using the sample database, a scripted dataSet, a flat file dataSet, XML, or any other way I can run the report, that has this issue, I'll take a look.
BirtUser79
Thank you Michael. I never used scripted or flat file data set, but I will try to create a dummy design file and will let you know.
Btw, can you let me know pageNumber variable which you have used is your design file is standard BIRT public variable which is available in design?
Also I have set many visibility conditions on tables/grids in my design, does that affect behavior of page counting?