hiding crosstab columns in BIRT when format is excel

大兔子大兔子 提交于 2019-12-12 03:44:58

问题


I want to hide two of the crosstab columns based on some condition. I have been able to achieve it by using

 function onPrepareCell( cell, reportContext )
 if(some condition){
    if( cell.getCellID() == cell#){
    cell.getStyle().setDisplay("none");
    }
  }

in the onPrepare event of cross tab. It works fine in PDF,HTML format but the columns are not getting hidden when the format is Excel. I need to get this done soon please help


回答1:


I got the answer from BIRT exchange i am posting the answer here so that it may be helpful to others

In the onPrepare() event of crosstab you can write the code as given below

function onPrepareCrosstab( crosstab, reportContext ) {
if(some condition ){ reportContext.getDesignHandle().getElementByID(ElementId#).setStringProperty("width","0px"); }

}

here ElementId# is the Id# of the cell you want to hide. As you can see we can also use this to change the width of the cell dymanically.




回答2:


Try your code in an OnCreateCell event.



来源:https://stackoverflow.com/questions/12781260/hiding-crosstab-columns-in-birt-when-format-is-excel

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!