Search code examples
reportbirtmaximo

Pass parameter from one child dataset to another child data set in BIRT report


I would like to know how can we pass parameter from child dataset to another child dataset. For example I have 5 dataset in BIRT report and I am passing the parameter from main dataset to 4 dataset however for the 5th data set I would like to pass the parameter from 4th dataset instead of the main dataset. Please let me know how can we achieve it. I tried the below in open method however it didn't work.

 where joblabor.jpnum =? 
 childDataSet.setQuery(sqlText);
 childDataSet.setQueryParameterValue(1, rows[1]["jpnum"]);

Solution

  • Just change your layout struncture from this:

    List/Table Main
      List/Table Child1
      List/Table Child2
      List/Table Child3
      List/Table Child4
      List/Table Child5
    

    to this:

    List/Table Main
      List/Table Child1
      List/Table Child2
      List/Table Child3
      List/Table Child4
        List/Table Child5
    

    Note how Child5 is now a child of Child4.

    Alternatively, you can do it like this:

    List/Table Main
      Dynamic Text Item bound to Child4 -- hidden, sets a report variable 
      List/Table Child1
      List/Table Child2
      List/Table Child3
      List/Table Child4
      List/Table Child5 -- uses the report variable
    

    Any way, your data model requires that the query for Child 4 will return at most one row.