Include Report Items from Multiple Libraries

Hi All,


 


I have 3 libraries:-


1. Having 1 grid 1*1


2. Having a Chart 1


3. Having Chart 2


 


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).


I wan't to include these 2 libraries at run time only not statically during design time.


 


When I am doing so onPrepare event of reportDeisgn I am getting following error.


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="onPrepare"]#42)


 


cell.getContent().add("chartName"); --- throwing when I am adding chart to grid cell.


 


Regards


Shasha


Comments

  • Best practices is to use report items as whole similar to this example. http://developer.actuate.com/community/forum/index.php?/files/file/810-dynamic-content-from-library/


     


    BTW, why 3 libraries? 


  • Thanks for the reply Mica.


     


    Usually i use the same approach as you have mentioned above.


    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. 


    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.


     


    Regards


    Shashank


  • 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).


     


    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.


     


    Regards


    Shasha


Sign In or Register to comment.