Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
Designing Analytics Reports
set PageBreakInterval dynamically during onCreate
Migrateduser
<p>I have two tables on a page: </p>
<p> </p>
<p>the size/number of rows in the two tables are variable. </p>
<p> </p>
<p>The problem I am facing is, that when both the tables have rows more than the page can fit, but less than the pagebreakInterval of the two tables which is set to 34,40 respectively, the tables shrink and wrap.</p>
<p> </p>
<p>hence I am trying to write this code to stop the wrapping on the onCreate function of table 2.</p>
<p> </p>
<p>//table 1</p>
<div>var t1 = reportContext.getPersistentGlobalVariable("totRowCountTbl1");</div>
<div> </div>
<div>//table 2</div>
<div>var t2 = this.getRowData().getExpressionValue("row[Aggregation_1]");</div>
<div> </div>
<div>var val; </div>
<div> </div>
<div>if(t1 != 0){</div>
<div> val = t1 % 34; //34 is the max number of rows that can fit in the page. </div>
<div> // val stores the remainder of rows left on the new page to be displayed.</div>
<div> // I use this info to determine where to break the table 2. </div>
<div>}</div>
<div> </div>
<div> </div>
<div>if(t1 != 0){</div>
<div> if(t2 != 0){</div>
<div> var sum = parseInt(t1) + parseInt(t2);</div>
<div> </div>
<div> if(val == 0 ){</div>
<div> this.getStyle().pageBreakBefore = "Always";</div>
<div> }</div>
<div> if(val != 0 ){</div>
<div> var t2Break = Math.abs(val - 34);</div>
<div> log("t2"+t2Break);</div>
<div> </div>
<div>// the code below does not take any effect (whats wrong here)</div>
<div> </div>
<div>reportContext.getDesignHandle().findElement("table2Name").setIntProperty("pageBreakInterval",t2Break);</div>
<div> }<span> </span></div>
<div> }</div>
<div>}</div>
<div> </div>
<div>also BUG: the pageBreakInside does not have any effect when set to auto, hence all this code above. </div>
<div> </div>
<div>Thanks for the help in advanced. </div>
<div> </div>
<div> </div>
<div> </div>
Find more posts tagged with
Comments
There are no comments yet