Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Dynamic hiding of grid data
shir
<p>Hi,</p><p> </p><p>I will start by giving a brief of my BIRT report design and the problems i am facing:</p><p> </p><p>I am creating a BIRT report which will have details of the end time of particular batch jobs. we have multiple applications for which i need to publish the job end times.</p><p> </p><p>i have designed the report in a grid; left hand side is a simple label with the application name, right hand side cell has the end time of all the jobs of that particular application</p><p><start of grid row 1></p><p>| | END time of job 1: <hh:mm> |</p><p>| | END time of job 2: <hh:mm> |</p><p>| Application 1 | END time of job 3: <hh:mm> |</p><p>| | END time of job 4: <hh:mm> |</p><p>| | END time of job 5: <hh:mm> |</p><p><end of grid row 1></p><p><start of grid row 2></p><p>| | END time of job 1: <hh:mm> |</p><p>| | END time of job 2: <hh:mm> |</p><p>| Application 2 | END time of job 3: <hh:mm> |</p><p>| | END time of job 4: <hh:mm> |</p><p>| | END time of job 5: <hh:mm> |</p><p><end of grid row 2></p><p> </p><p>I have attached a screen shot for the same.</p><p>I am getting the job end time from a simple sql query (select END_TIME_1 from TABLE where....)</p><p>I drag-drop the data element to the grid cell and edit the data binding as</p><p> </p><p>"END time of job1:"+dataSetRow["END_TIME_1"]</p><p> </p><p>Now the requirement is i want to hide the 'data element' inside the grid cell whenever the date time is null (i.e. job has not yet ended)</p><p> </p><p>I have tried realising this by two ways</p><p> </p><p>Method One:</p><p>Property Editor-Data>Visibility>Hide Element>For Specific outputs and put in the expression</p><p> </p><p>dataSetRow["END_TIME_1"] == null and,</p><p>dataSetRow["END_TIME_1"] == "" and,</p><p>row["END_TIME_1"] == null and,</p><p>row["END_TIME_1"] == "" and,</p><p> </p><p>but none of the above is working</p><p> </p><p>Method two:</p><p> </p><p>For the data element i tried to write a simple javascript</p><p> </p><p>in onRender</p><p>if(dataSetRow["END_TIME_1"] == null ){</p><p><strong class='bbc'>this</strong>.getStyle().lineHeight=0;</p><p>}</p><p> </p><p>I have tried to add the data set to the grid column binding, however there is no change in the output (aditionally each job end time comes from a different table , hence i suppose we cant add all the different column bindings for different data set for a sinle grid cell)</p><p> </p><p>Can anybody suggest as how to achieve this (hiding of the data element when the END_TIME_1 returns a null value.)</p><p> </p><p>Can this be done with the existing design, i.e. multiple data elements within a single grid cell</p><p> </p><p> </p><p> </p><p>To add: i am using BIRT RCP report designer, 4_3_1</p>
Find more posts tagged with
Comments
GLO_FR
<p>Hi,</p><p> </p><p>Firts of all, you will have to join your different datasets and bind the final one to your grid (in SQL use an UNION for instance)</p><p> </p><p>After you can create a calculated field which will specifiy if the grid has to be visible or not.</p><p>At the end, use the visibility option with the computed field to hide or not the grid.</p><p> </p><p>Here is a quick example :</p><p><a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/devshare/_/designing-birt-reports/hiding-grid-dynamicaly-with-the-visibility-fiunctionnality-r1633'>http://developer.actuate.com/community/devshare/...</a></p>
;
shir
<p>Thanks,</p><p> </p><p>I too got it to work around by using birt string function,</p><p> </p><p>BirtStr.search("null",row["FIELD_NAME"])!=-1 (i.e. do not display when null value is present in the data set extract)</p>