Birt 2.1.1中table row背景颜色交替显示

Birt 2.1.1中table row背景颜色交替显示


选中table的detail行,切换到script标签,在onPrepare事件中输入
 
count = 1 ;

在onCreate事件中输入
1 count ++ ;
2 this .getStyle().backgroundColor = (count % 2 == 0 ? " red " : " blue " );

或是直接打开xml source,在相应的detail位置上修改源码为
                 < detail >
                  
< row  id ="66" >
                    .
                    
< method  name ="onPrepare" > <![CDATA[ count=1; ]]> </ method >
                    
< method  name ="onCreate" > <![CDATA[ count++;this.getStyle().backgroundColor=(count%2==0?"red":"blue"); ]]> </ method >
                    ..

xxxxx.jpg

你可能感兴趣的:(Birt 2.1.1中table row背景颜色交替显示)