Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Page break between sequential Tables
siva_birt
Hi,
This is about pagebreak between Tables when there is no Data.
I have Two tables (table1,table2)in sequential order.
Each table has its own dataset and input parameters.
In BeforeFactory method, I have this code.
if(params["param_for_table1"].value){
Table2 = reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("Table2").setProperty("pageBreakBefore","Always");
}
Scenorio1: When there is data in dataset1 of table1, page break applied correctly.
scenorio2: When there is no data in dataset1 of table1, still page break is applied . An empty page appears.
I am not supposed to show empty page.
That means when Total.count()==0( for table1) then Pagebreakbefore(for table2) must be "Auto".
I tried this in all the methods of Table. None is working.
Please help to find a solution.
Thanks...
Find more posts tagged with
Comments
micajblock
Set the page break after on the first table to avoid. Then on the table onCreate have code similar to below:
if( this.getRowData().getColumnValue("OFFICECODE")>0){
this.getStyle().pageBreakAfter = "always";
}
where OFFICECODE is some field on the data that will have a value above 0 if there is data. In other words you want to add the page break if there is data.
siva_birt
Thank you very much. It worked well for two tables. But when I added two more tables, it failed for different combinations. Still working on it. If you have any simple way of doing it, please help.
micajblock
<blockquote class='ipsBlockquote' data-author="'siva_birt'" data-cid="107158" data-time="1342127866" data-date="12 July 2012 - 02:17 PM"><p>
Thank you very much. It worked well for two tables. But when I added two more tables, it failed for different combinations. Still working on it. If you have any simple way of doing it, please help.<br /></p></blockquote>
What do you meant it falied? Why would it be any differenct for mutiple tables. Set the page break on all tables to avoid and add the page break only if there is data.
robilco
Think I'm seeing the exact same issue
www.birt-exchange.org/org/forum/index.php/topic/27455-how-to-avoid-page-breaks-in-a-table/
Any advice appreciated.