Crystal reports Query for subreport

23 Views Asked by At
Task User
Containment (Co User) User1
Disposition (Do User) User2
Investigation(Io User) User3
Approval (Ao User) User4

I have the above data coming in preview of a sub-report, now I want to suppress any of this row based on a field that is available outside of this subreport. Consider this field as Taskname

Scenario1: If the field TaskName = 'Containment' then the output of the subreport should be like the below

Task User
Disposition (Do User) User2
Investigation(Io User) User3
Approval (Ao User) User4

Scenario2: If the field TaskName = 'Disposition' then the output of the subreport should be like the below

Task User
Containment (Co User) User1
Investigation(Io User) User3
Approval (Ao User) User4

I am unable to get any answer for this

1

There are 1 best solutions below

2
MilletSoftware On

Pass the task from the main report as a subreport link. In the subreport, if you go into the Report, Selection Formula, Record... you would then see something like:

{SomeTable.Taks} = {?Pm-SomeTable.Taks}

Simply change it to:

{SomeTable.Taks} <> {?Pm-SomeTable.Taks}