oracle-databaseobieebi-publisheroracle-bi

Nested loop in Oracle BI Publisher .RTF template


I have two nested loops each one use a different node to get data:

1) <?for-each-group:/DATA/TEST/ROW;./target_test?>  
2) <?for-each:/DATA/TEST2/ROW?>

Looping with the first group for each target_test I generate a page of report and with the second group I fill a table. At this point the report works well if I have just one target_test, but if I have have more target_test the table is filled with all target_test and not only with the one which upper loop is refered. So as result for example i have the page with target_test = data1 that in the table contains also target_test = data2, target_test = data3 etc..

My question is: is possible to check with a condition if target_test in the second loop is equal to target test in the first loop? With this condition I can simply hide rows of the table when condition is not true.


Solution

  • You are telling the code to do this:

    For every row in test with a different target_test value, loop over every row in TEST2.

    So this is expected behaviour. You do not specify how the outer loop target_test should affect the inner loop.

    You probably want something like this:

    <?for-each-group:/DATA/TEST/ROW;./target_test?>  
    <?for-each:/DATA/TEST2/ROW[target_test=current-group()/target_test]?>
    do something
    <?end for-each?>
    <?end for-each-group?>
    

    If this doesn't help, please provide a reproducible example with a data sample.