Include Report Items from Multiple Libraries

Shasha
edited February 11, 2022 in Analytics #1
<p>Hi All,</p>
<p> </p>
<p>I have 3 libraries:-</p>
<p>1. Having 1 grid 1*1</p>
<p>2. Having a Chart 1</p>
<p>3. Having Chart 2</p>
<p> </p>
<p>Now in a blank report design based on user input I should include Lib & (Lib 2 or Lib 3 - based on what chart user has selected).</p>
<p>I wan't to include these 2 libraries at run time only not statically during design time.</p>
<p> </p>
<p>When I am doing so onPrepare event of reportDeisgn I am getting following error.</p>
<p><span style="font-size:8pt;font-family:'courier new';color:#000000;">Wrapped org.eclipse.birt.report.model.api.command.ContentException: The Chart("xyz") is not allowed directly or indirectly inside the Grid("1X1").Rows[0].Cells[0]'s slot(Content). (/report/method[@name=&quot;onPrepare"]#42)</span></p>
<p> </p>
<p>cell.getContent().add("chartName"); --- throwing when I am adding chart to grid cell.</p>
<p> </p>
<p>Regards</p>
<p>Shasha</p>

Comments

  • <p>Best practices is to use report items as whole similar to this example. <a data-ipb='nomediaparse' href='http://developer.actuate.com/community/forum/index.php?/files/file/810-dynamic-content-from-library/'>http://developer.actuate.com/community/forum/index.php?/files/file/810-dynamic-content-from-library/</a></p&gt;
    <p> </p>
    <p>BTW, why 3 libraries? </p>
  • <p>Thanks for the reply Mica.</p>
    <p> </p>
    <p>Usually i use the same approach as you have mentioned above.</p>
    <p>But now we have a requirement where we have almost 200-300 report items. Now based on some common features we have splitted them into different libraries. </p>
    <p>Also, we want user to decide the page structure by themselves so we first he is choosing the grid as container and then placing each report item in onPrepare of report.</p>
    <p> </p>
    <p>Regards</p>
    <p>Shashank</p>
  • <p>Forgot to update that this approach is working fine when we are adding the libraries statically into the report design. This problem is coming when I am including the libraries at run time (As we have 30-40 libraries and only 3-4 may be required for a single report).</p>
    <p> </p>
    <p>Also this gives us flexibility during deployment time also we don't have to redeploy the existing report every time there is a new library and just add the new library to the resource folder.</p>
    <p> </p>
    <p>Regards</p>
    <p>Shasha</p>