birt 如何设置每一页行数

2025年03月22日 20:46
有2个网友回答
网友(1):

新建table,选择表格,点script,在onprepare事件里写:count=0;
再选择明细行,在明细行script oncreate方法里写:
count++;
if(count%10 ==0){
style.pageBreakAfter ="Always"; //设置每页显示10行
}
if(count%2 !=0){
style.setBackgroundColor("gray");
}else{
style.setBackgroundColor("white");//隔行变色
}
注意,在Eclipce里面预览可能看不到10行显示效果,报表用tomcat或者其他工具发布后应该能看到。

网友(2):

报表body属性的advanced里面有个Page break interval就是行数