A subreport is effectively a method of embedding a report within a report. Finished Reports supports subreport functionality.
In the following example we're going to create a subreport that totals the transactions by year for each client, and then displays the yearly totals at the bottom of the client section of the report. Here's our example output prior to adding a subreport:
Before we review adding a subreport let's review what adding simple group totals for each year, for each client, without using a subreport, looks like. As you can see below each monthly total is followed by the yearly total.
Our goal is to show a yearly subtotals at the bottom of each client's portion of the report. When completed our report will look like this:
Step by Step
Subreports are linked to the main report using a parameter binding. Before adding a subreport, create the parameter that will be used for binding the main and subreport together. In this example we are going to associate the yearly total with each Client and created a string parameter called ?SubReportClientParam?
Next launch Finished Reports and drop a subreport into the Client's group footer. We are using the Client's group footer section* as our goal is to show yearly totals for each client.
*Subreports can be added to any section of your report.
Double click on the subreport to build and edit the subreport. In our example we have grouped our report by Client and Assigned Year, with the yearly totals placed on the Assigned Year's group footer.
After the subreport has been created, you can Preview the subreport by clicking Preview. As you can see there are two sets of yearly totals. One for Client1 and the other for Client2.
Next we need to set the Filter String on the subreport. The filter string is going to utilize the ?SubReportClientParam? parameter we created earlier and limits the subreport's data to each individual Client. Click on the subreport's smart tag and click the ... button next to Filter String.
Set the Filter where the Client is equal to the ?SubReportClientParam? View Parameter.
Next, click on the main report's designer tab, click the subreport's smart tag and Edit Parameter Bindings.
Add a new Parameter Binding. Set the Binding to the Client field and select or manually type (case sensitive) in the Parameter Name that was created at the View Level. The parameter name will be prefixed with "ViewParameter_". When completed click OK.
Click Save. Next, click Preview to view the results:
In the image above we see each Client's yearly totals, listed together, in the Client's Group Footer.