<p>Hi,</p>
<p> </p>
<p>I'm experiencing a problem regarding cell hiding in a crosstab in the attached report. The report itself contains two crosstab: please refer only to the second one, the one with element id 2888.</p>
<p> </p>
<p>As you can see the crosstab takes a dimension from the cube (called Anno_contab...anno states for "year" in italian language)). Under this dimension we have a triple of values you can find under the measure called Summary_contab.</p>
<p> </p>
<p>My goal is: if the value of the dimension is 0 (due to the fact that the query is structured with full join that produces null values for years that are not present) then i must hide the dimension cell together with the 3 measure header and the 3 measure values (which in that specific case will be empty).</p>
<p> </p>
<p>I tried to script the onRender event as follow</p>
<pre class="_prettyXprint _lang-js">
/**
* Called when crosstab cell is being rendered.
*
*
@param cellInst
* ICrosstabCellInstance
*
@param reportContext
* IReportContext
*/
function onRenderCell( cellInst, reportContext )
{
// this is the cell ids that start the condition of the script
// if the engine is rendering id 3809 anche its data value equals to "ANNO 0"
// i want to set display none to this cell as well as for ids 3814, 3942, 3947 (headers)
// and ids 3812, 3940, 3945 (values) if and only if those values are empty!!!!
//
if (cellInst.getCellID()==3809)
{
if (cellInst.getDataValue("ANNO_CONTAB")=="ANNO 0")
{
cellInst.getStyle().setDisplay("none");
//I want also to set display none to the below cell ids
//These ids are the summary headers (measures headers)
//reportContext.getDesignHandle().getElementByID(3814).getStyle().setDisplay("none");
//reportContext.getDesignHandle().getElementByID(3942).getStyle().setDisplay("none");
//reportContext.getDesignHandle().getElementByID(3947).getStyle().setDisplay("none");
//These ids are the summary values (measuere values extracted by the cube)
//reportContext.getDesignHandle().getElementByID(3812).getStyle().setDisplay("none");
//reportContext.getDesignHandle().getElementByID(3940).getStyle().setDisplay("none");
//reportContext.getDesignHandle().getElementByID(3945).getStyle().setDisplay("none");
}
}
}
</pre>
<p>Commented line represents some unsuccessful tries I did before posting this thread.</p>
<p>If i point directly the other ids stated in the commented code I can hide the cells but they will be hidden even for other records that has values inside.</p>
<p> </p>
<p>Should I use a different strategy? Can I obtain the child of a cell starting from id 3809? When the engine is rendering cell 3809, is it referring to all the "Anno X" cells in the report with that ID, am I right? (the one eventually with "Anno 0" value as well as other possibly having "Anno 2015" for example?</p>
<p> </p>
<p>Let me know if you need more details to explain this scenario.</p>
<p> </p>
<p>Thanks in advance.</p>
<p> </p>
<p>Simone</p>