Home
Analytics
Does BIRT still execute a query if an element is hidden?
mkdz
<p>If I have a dataset that is bound to a table and I set the visibility of the table to hidden, does the query in the dataset still execute when I run the report? If so, is there any way to make it not execute?</p><p> </p><p>Additionally, let's say I have another dataset. There are two tables bound to it. When I run the report, are two queries run or just one?</p><p> </p><p>Thanks!</p>
Find more posts tagged with
Comments
Tubal
<p>Yes, BIRT will execute the query for hidden elements. If you don't want it to run, you would need to drop the element it's bound to in the beforeFactory script of the report. For example, if you test for a certain user when the report runs, you can drop the tables you don't want the user to see in your before factory, and the query will never run:</p><p> </p><div><pre class="_prettyXprint">if (user!=myUser) { var myGrid = reportContext.getDesignHandle().findElement("myGrid"); myGrid.drop(); //this line removes the grid from the report object model just for this run}}</pre></div><p> </p><p>No, BIRT typically won't run the same query multiple times, even if multiple tables are bound to it. I've had it happen before for unknown reasons, but the general rule is that it will cache the data and reuse it for different tables.</p>