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 table / element creation insted of hiding
LauraGtp
<p>Hello everybody,</p><p> </p><p>I am new in this forum and not very experienced with Birt reporting.I have a question that I've been wondering for a long time and would like to know if someone could help me.</p><p> </p><p>I am designing a report with many tables and charts. The target is to show to the user different tables and charts depending on some input parameters that are chosen at the beginning in the prompt window.</p><p> </p><p>Until now, I've been using the "Visibility" property to hide those tables/charts that should not be shown. However, for a second version of the report, I have to include more tables and charts. The problem is that it takes a lot of time to run this report, as there are many elements to create.</p><p> </p><p>I would like to know if it is possible to do "conditional" creation of tables and charts. I mean, if it is possible to avoid the creation of a table based on a condition (if this condition is false, do not create the table), in order to save some time when running the report.</p><p> </p><p>Many thanks in advance!</p><p> </p>
Find more posts tagged with
Comments
fmakwsi
<p>Had the same prob as you and i've got the advice to do it with the visiblity. dont like it either because you are totally write about the time problem. </p><p> </p><p>but there might be the posiblity to avoid the creation of a table on the "onPrepare" method, havent tried or done some research about it</p>
micajblock
<p>Take a look at this example.</p><p> </p><p><a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/devshare/_/designing-birt-reports/1495-dynamic-content-from-library'>http://developer.actuate.com/community/devshare/_/designing-birt-reports/1495-dynamic-content-from-library</a></p>
;
LauraGtp
<p>Hi,</p><p>I finally read about a solution in another forum. The point is to drop the creation of the elements in the "onPrepare" phase, as fmakwsi suggested.</p><p> </p><p>Thanks!</p>
fmakwsi
<p>Could you post your solution, so that we can have a better overview above the possibilites :-)</p>
johnw
<p>You are better off with going with a subtraction method in your design instead of adding tables. By adding, you will need to maintain a lot more code to add new tables. With subtractive, you can visually keep your tables and charts in the design, and then use a simple method in the initialize or beforeFactory events to just remove tables not selected in the design.</p><p> </p><p>The code to remove the table would be</p><pre class="_prettyXprint _lang-js">reportContext.getDesignHandle().findElement("GenderChart").drop();</pre><p>Once a table is dropped from the design, the associated data set will not be executed, so it should improve the performance somewhat. The more tables you include in the design that use different data sets will increase execution time.</p>
johnw
<p>An example is attached</p>
LauraGtp
<p>Hi!!</p><p> </p><p>I used something similar, I found it in the next post (I don't wanna do the solution mine
):</p><p> </p><p><a data-ipb='nomediaparse' href='
http://www.eclipse.org/forums/index.php?t=rview&goto=1240540#msg_1240540'>http://www.eclipse.org/forums/index.php?t=rview&goto=1240540#msg_1240540</a></p><p> </p><p>Only
thing is that I used it in the onPrepare phase of the grid creation, I don't know if it's the best way but it works fine for me, it saves a lot of running time.</p><p> </p><p>Hope it helps!</p>