Using sub-report values in main-report

I have sub-report:  

Shared stringvar O;

if trim({ICITEMO.VALUE}) = "CS" then

    O := "B"

Else

    O := " ";

And formula in main- report: Shared stringvar O;   O

In main report I am trying to exclude all items with optional field value “B”. Sub- report is working correctly but not formula in main report, which is giving me false results.

Any tips how to solve this issue?

 

Thanks

  • Make sure your subreport is in a Section before the section where you want to display that value.  And then, if you’re trying to exclude B’s, you can only do it by conditional suppression of the section or group.  You can’t have a record selection formula based on a subreport because it selects records for the main report before it reads the subreport.