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)
Conditional section alternative
Birtnewbe
in erdpro we have conditional section where we can execute report based on the parameter value. What is the way this is acheived in BIRT? Based on the parameter i would like to execute dataset1 and dont execute dataset2 and accordingly show table1 but hide table2
Find more posts tagged with
Comments
Tubal
Probably the easiest way would be set up your report with both dataset and tables, and then in your beforeFactory script event, drop the one you don't want based on your report parameter.<br />
<br />
You would need to name your table elements, for example table1 and table2.<br />
<br />
In your beforeFactory, something along the lines of:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>if(params["myParamter"] == "myString") {
var table1 = reportContext.getDesignHandle().findElement("table1");
table1.drop();
} else {
var table2 = reportContext.getDesignHandle().findElement("table2");
table2.drop();
}</pre>
<br />
By dropping the table (rather than hiding it), your query is never ran, so it will save you time on longer queries.
Birtnewbe
Thanks for replying, i will try this approach.