When creating a report, sometime we need to use a subreport. Same as the main report, we also need to use parameter in sub report query. And the parameter used for the sub query report is a result from the main report.
Below are some steps on how to use result from main report as parameter for sub report :
- Make sure your subquery report is correct and there’s no other parameter needed to be setup.
- Return to main report , and then right click in subreport area and choose “Change Subreport Link”.
- In the left box, find “Command”
- Then select which column will be used as parameter (in this example: BatchNum) . Click the selected column and then click on button “>” . Make sure “select data in subreport “ already checked, and then choose column that will be use for subreport (in this example also use “BatchNum).
- Click “OK” and it will automatically create a parameter in subreport. If we look at the query, there’s nothing change. But don’t worry because it’s already mapped automatically.
Also read: