Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Being able to change an attribute based on output type (i.e PDF,HTML) @ runtime
rafidwahab
The pageBreakInterval has been an obstacle for my team as the have to identify how many rows each page must have or set the value of the "pageBreakInterval" to 0 which will automatically break the page for PDF.
The issue I have seen and read is that for HTML if the "pageBreakInterval" is 0 while PDF will auto pageBreak, then all the data is displayed on one screen in one single HTML page.
A team member have found a script that can identify to me which output I am currently running but it seems that this check while works well in the designer running a PDF, does not work in the WebViewer. It seems to show HTML as the output even when generateing PDF be using cache data.
---> I would like to know if there is a way to change a value of pageBreakInterval to 0 at runtime if the requested output is PDF.
----> If there is any other advise on how to better handle pageBreaks, please let me know.
Find more posts tagged with
Comments
mwilliams
Hi rafidwahab,
What version of BIRT are you using?
rafidwahab
Hi Michael,
I am currently using two version 2.2.2 and 2.5. We are looking to upgrade and I was evaluating if this many have been solved, handled differently in 2.5.
Please let me know if you need anything further.
Regards,
Rafid
rafidwahab
Michael,
Has there been any update on the query above, or is there something I can do in the design file to identify the type of execution I am doing inside of the Report Design at runtime when exporting to PDF.
----
The issue is that the PDF only Auto PageBreaks when you have the pageBreak set to Zero, but this then creates only one HTML page with all th values.
I think a good idea would be to create a checkbox/options which would allow you to control the pagebreak independly for different output types.
I am not sure how this would affect the implementation of your emitters though.
Regards,
Rafid Waab
mwilliams
Rafid,
Sorry for the delay. If you put the following script in your beforeFactory script, you should be able to change the page break interval of your table to whatever value you specify, depending on output.
format = reportContext.getOutputFormat();
if (format = "pdf"){
reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("mytable").setProperty("pageBreakInterval",0);
}
The table in this example was named "mytable". This test was done in BIRT 2.5.0.