Home
Analytics
How to add page break at specified row.
shi
Hello folks,
I am using BIRT 2.3.2.
I need to add a page break at specified row on the table and cross tab.
It needs to have no relation with any groups or total row.
But I could not find that way. I would like to know how I can do that.
Any help would be appreciated.
Thanks,
SYK
Find more posts tagged with
Comments
mwilliams
Hi SYK,
How do you determine which line to break after?
shi
Michael,
It's determined by fixed number of the row (a vertical line).
I'd like to specify that number.
When it will be done page break, it needs to count every rows, including all of the data element on the cross-tab and the table.
Thanks and regards,
SYK
mwilliams
SYK,
You can use a variable to create a custom line counter for you. You just have to increment it for each row and remember to have a check so that you can add the header rows too. Then, you'd just reset your variables in the table/crosstab's onPageBreak event. In the onCreate of the table row or row dimension element in your crosstab, you'd increment your counter set the pagebreak manually by using 'this.getStyle().pageBreakAfter = "always"' if you reach your specified row count. Hope this helps. Let me know if you have questions.
shi
Hello Michael,
Thank you for your reply.
I'd like to know more details information.
Would you please tell me how to use variable for this case...
I tried to add the counting method into the report script like the below.
But It did not succeed.
<additional scripts>
report.rptdesign > initialize > VAR RC=0
report.rptdesign > befireRender > reportContext.setPersistentGlobalVariable("rc",rc);
croostab header > on Create >
importPackage(Packages.org.eclipse.birt.report.model.api);
if( rc = 1){
this.getStyle().pageBreakAfter = "Always";
rc ==0 ;}
crosstab cells > rc++
Any help would be appreciated.
regards,
SYK
mwilliams
SYK,
Take a look at the attached example. You can see where all the script is by looking at the script section of the outline. I specified the page break value in the script, but you could make it dynamic with a report parameter. Let me know if you have any questions.
shi
Hello Michael,
That's surely helpful to me.
I will try it.
Thank you so much for your help!
SYK
mwilliams
SYK,
No problem. Glad to help. Let me know if you run into any problems.