Community
Participate
Working Groups
Build Identifier: any Does BIRT provide the API for users to catch the report running result programmatically? for example, the users can catch the total number page number via report parameters or variables. Another question on pagination: can the user customize the page numbers? for example, we can start from a specified page number, not always starting from 1. Thanks, James Reproducible: Always
For page number, if what you need is just the page count, you can generate report document by RunTask and retrieve page count from ReportDocument. If you want get page number/count at render time, you can define onPageStart/onPageEnd script to invoke your code. For example, say there is a class test.Test.java, define such script in onInitialize: test = new Packages.test.Test(); define following script in onPageEnd: test.setPageNumber( pageNumber); Currently, we can't define customized page number.
To get page number, a better way is to define a IPageHandler to engine task. I will try to find out a workaround to customize page number.
Please provide a sample to customize page numbers with page variables.
Created attachment 171777 [details] sample to customize page numbers with page variables starting from 2. the steps to use the page variable: (1)New a page variable named "page_num"; (2)Add script on master page's onPageStart: reportContext.setPageVariable("page_num",pageNumber+1); (3)Drag page variable from AutoText to master page footer. (4)View report in web viewer and export to any format that you want. But page variable does not worked if you does not use web viewer,please see bug #276647:https://bugs.eclipse.org/bugs/show_bug.cgi?id=276647
Set the resolution to worksforme.
Thanks. It looks that it only works for the first page.
Created attachment 173271 [details] test result
Hi, The page variables works well in my test, please see the attachment. You should use web viewer and export the report. Thanks, Jingwen