2017-06-18 88 views
0

我知道如何在Excel Birt導出交叉表或單元格in this question的「onprepare」事件時隱藏交叉表列。在Birt的「onPrepareCell」事件中訪問單元格的數據值

我的問題是如何在「onPrepareCell」事件,因此,例如,如果值=「EURO」設置該單元的寬度爲0,就像這樣,如下訪問單元的數據值:

function onPrepareCell(cell, reportContext) 
if(cell.getReport.getDataItem("CURRENCY") == "EURO"){ 
    if(cell.getCellID() == cell#){ 
    reportContext.getDesignHandle().getElementByID(ElementId#).setStringProperty("width","0px"); 
    } 
} 

但我無法從IDataItem中提取值。

+0

請仔細閱讀[在什麼情況下我想補充「緊急「或其他類似的短語來解決我的問題,以獲得更快的答案?](// meta.stackoverflow.com/q/326569) - 總結是,這不是解決志願者問題的理想方式,而且可能適得其反獲得答案。請不要將這添加到您的問題。 – halfer

回答

0

我們不能 onPrepareCell(細胞,reportContext)訪問的DataItem

而是使用報表參數從交叉表外

onPrepareCell(cell, reportContext){ 
    if (reportContext.getParameterValue("CURRENCY") == "EURO") { 
     if (cell.getCellID() == cell#){ 
      reportContext.getDesignHandle().getElementByID(ElementId#).setStringProperty("width", "0px"); 
     } 
    } 
} 
相關問題