Home
Analytics
Setting BIRT visibility for table based on alternative dataset size
bluesky
I'm relatively new to BIRT (2.5.2 which is a bit old I know) and have a problem.
I have a BIRT report with two datasets and two tables bound one to each. I only want table2 to show if the dataset of table1 is empty. I'm trying to use the visibility option but don't know how to specify the condition which I assume is done via some form of scripting.
Any help very much appreciated
Thanks
Ian
Find more posts tagged with
Comments
mwilliams
Hello Ian,
Welcome to BIRT and to BIRT-Exchange. Take a look at this report. You'll see a variable is set in the onFetch of the first dataSet and you can see how it is used to show/hide the correct table by looking at the visibility expression for each table, in the property editor. To see the first table, use the default parameter value of 120000. To see how it switches to the second table, if no values are returned for the first, enter 300000. Hope this helps.
bluesky
Hi Michael, thanks for this
Tried your solution but the global parameter isn't being set - I changed the report to output the value and it shows as null so both tables are displayed. I'm setting visibility of Table2 to hide using Total.count() < 1 which works fine but I just can't get the other bit to work. Any ideas what might be the problem?
Many thanks for the help, much appreciated
Ian
mwilliams
What output are you using? It works fine for me in the preview, HTML, pdf, and the web viewer.
bluesky
Sorry should have said - your example works ok for me but when I try the same thing in my report it doesn't work. My output is pdf by the way
mwilliams
Can you attach your design? If not, can you send it to me in email?