Import Report Items dynamically from Library at runtime

Shasha
edited February 11, 2022 in Analytics #1
<p>Hi,</p>
<p> </p>
<p>I need to import BIRT report Items (table/chart/grid) from a common library at runtime of a report.</p>
<p> </p>
<p>I will pass a parameter to a report and at runtime only report items should be added into report design so that all the components are not loaded and report processing time is less. </p>
<p> </p>
<p>I am trying to call DEAPI on beforeOpen even of report but unable to add components.</p>
<p> </p>
<p>Sample code is as follows:</p>
<p> </p>
<p>importPackage (Packages.org.eclipse.birt.report.model.api);</p>
<p>LibraryHandle lib =reportContext.getDesignHandle().findLibrary("resources/dynamicComponents.rptlibrary");<br><br>
DesignElementHandle deh = lib.findElement("NewTable");</p>
<p>report.getBody().add(deh);</p>
<p> </p>
<p><span style="font-size:13px;background-color:rgb(244,244,244);">Regards</span></p>
<p><span style="font-size:13px;background-color:rgb(244,244,244);">Shashank</span></p>

Comments