cancel
Showing results for 
Search instead for 
Did you mean: 

Passing a list of records from sub report to main report.

Former Member
0 Kudos

Hi Experts,

hopefully you can help me out with this issue.

I am trying to pass a list of records from a main report to a sub report.

My purpose eventually is to mark records in the sub report that are not available in the main report and

to suppress the records in the sub report when they are also there in the main report.

Linking the sub report to the main report is not an option in this case (in my opinion).

It would only suppress the records in the sub report I would like to appear.

For example the main report contains records;

1

2

3

4

5

and the sub report contains records;

1

2

3

4

5

6

7

8

9

10

as you can see both records have records 1-5.

So now the sub report has to suppress records 1-5 so that only records 6-10 are visible in the sub report.

If I try to pass values with a shared formula it seems it is only passing the first or last record from the main to the sub report and not the

whole list of records.

Thank you in advance for your time and help.

BR

Pokey!

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Pokey,

If the Subreport is placed in the Report Footer, then you need to create a comma-separated string of values and pass it to the Subreport for filtering. Something like this:

1) Create this formula called 'Values' and place it on the Details section of the Main report:

stringvar s := s + totext({ID_field},0,"") + ", ";

2) Right-click the Subreport  > Change Subreport Links > Move the formula above to the Pane on the right > Uncheck the option 'Select data in subreport based on field"

3) In the Subreport go to Report > Selection formulas > Record and use this code:

Not(totext({ID_field},0,"") IN split({?Pm-@Values}, ", "))

-Abhilash

Former Member
0 Kudos

Hello Abhilash,

yes that's it!

Had to adjust the totext formula a bit because of the error "To many arguments give etc etc." (just deleted the ~ ,0,"" ~ part)

but then it works like a charm!

Thank you very much again for your time and effort in helping me!!

Much appreciated,

BR

Pokey!

Answers (0)