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, and also link the sub report to the main report so that the sub report prints the appropriate records associated with the group it describes. First, move the sub report into the Group Footer section of the Customer group. Next, link the sub report to the main report based on a common field between the reports, in this case Customer ID. You can link the sub report to the main report at any time after the sub report has been inserted on the report. To link an existing sub report:
With the main report Design tab open, click Edit, Sub report Links to open the Sub report Links dialog box. When you Initially Insert the sub report onto a main report, the Links tab available on the Insert Sub report dialog box.-You can link the sub report to the main report at this time, or you can come back later to open the Sub report Links dialog box, as I am doing In these steps.
2. Select a field from the Available Fields list (the main report) and click the right arrow button to move the field to the Field(s) ToLinkTolist.
3. With this complete, two list boxes appear at the bottom of the dialog box showing that SCR has created a parameter field for you based on the field you chose to link the two reports together. From the list below the Select Data in Sub report Based on Field check box, select the field in the sub report to which you want to link. SCR seems rather smart and has already chosen the correct field for me, as seen in.
4. Click OK to close the Sub report Links dialog box. Preview your report. You may need to move the sub report around or fine-tune your formatting so that the sub report lines up and looks the way you want in relation to the main report.