Scott Johnston
asked on
Crystal Report Subreport pasing formula field from main report to select record in sub report
I have main report which I have a formula field that finds code in the field using the MID function (I.E. ABC), I want to use that data to run the sub-report, looking for any data that is LIKE ABC.
Where do UI enter my report parameters so that the Main report passed the info to the sub report. I tried to use the link report but I not sure if I can add logic for the sub report to run?
Here a better way to put this.
I have a variable that is ABCDEF, I drop the first 2 characters using the mid function so now it is CDEF.
I pass the CDEF to look over a set of data to see if any of the records have this combination of characters. using a sub report to display its findings....
I hope I am making sense....
Where do UI enter my report parameters so that the Main report passed the info to the sub report. I tried to use the link report but I not sure if I can add logic for the sub report to run?
Here a better way to put this.
I have a variable that is ABCDEF, I drop the first 2 characters using the mid function so now it is CDEF.
I pass the CDEF to look over a set of data to see if any of the records have this combination of characters. using a sub report to display its findings....
I hope I am making sense....
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Got it, thanks
You would open the subreport in the editor and create a parameter in the subreport, and go to Report > Selection Formulas > Record and enter a formula that compares that parameter with the field in the subreport. If you're passing the entire field from the main report to the subreport, you can use Mid in the subreport to extract the desired characters. If you're already doing that extraction in the main report, then (obviously) you don't need to do it in the subreport.
Then you would link your field or formula in the main report to that parameter in the subreport.
James