有一种情况,表格中的任何一个都会增长,并且我希望该页面在某个点处断开,当总行数(累积的两个表格)增长超过某个点时,例如。 40。
每个页面都设计为网格 Grid1有两个表:
表1:我点击该表并转到onCreate of script选项卡。
table1 = this.getRowData().getExpressionValue('row[count]'); // row count contains the number of rows
reportContext.setPersistentGlobalVariable("table1", table1);
表2:我点击表格并转到onCreate of script选项卡。
table2 = this.getRowData().getExpressionValue('row[count1]');
reportContext.setPersistentGlobalVariable("table2", table2);
table1 = reportContext.getPersistentGlobalVariable("table1");
sum = table1 + table2;
if(sum > 30){
this.getStyle().pageBreakBefore = "always";
}
答案 0 :(得分:0)
onCreate OF表2:
var totRowCountFromTbl1 = reportContext.getPersistentGlobalVariable("totRowCountTbl1");
log(" totRowCountFromTbl1 : "+totRowCountFromTbl1);
var totRowCountFromtbl2 = this.getRowData().getExpressionValue("row[Aggregation_1]");
log(" totRowCountFromtbl2 : "+totRowCountFromtbl2);
if(totRowCountFromTbl1 != 0){
if(totRowCountFromtbl2 != 0){
var sum = parseInt(totRowCountFromTbl1) + parseInt(totRowCountFromtbl2);
if((sum >= 34) && (totRowCountFromTbl1 <= 33 )){
this.getStyle().pageBreakBefore = "Always";
}
}
}