Linking The Sub Report to The Main Report

After you have designed the main report and sub reports, you may want to select the field or fields used to link them together. Tills enable the report toshow specific data in the sub report as it corresponds to data in the main report.

Linking a sub report to a main report can be done at any time. When you link a sub report to a main report, SCR actually creates a parameter field in the sub report and uses it in the sub report selection criteria. When you refresh the main re­port, the main report answers the prompt asked by the sub report. The sub report then sends the main report the data that meets the specification of die prompt.

You will not sec any of this parameter action, SCR does it all for you auto­matically. You will be prompted for a value for the sub report parameter only if you preview just the sub report portion of a linked sub report.

This will make more sense when you see it in action, so in the next section I link the main report and sub report together.

Filtering Data in a Sub report by Linking to a Main Report

What if you want a sub report to print the top five products sold based on quantity for each customer, rather than for the entire report? You then need ‘ to move the sub report so that it prints once for every group