Configure charts to display data for the current report group. This example groups sales by Region and displays Sales Amount by Sales Rep within each region.
What Is Group-Level Charting?
Group-level charting displays a separate chart for each group in a Finished Report, using only the records that belong to that group.
In this example, each Region section contains a chart showing its sales reps and their total sales amounts.
Why Use Group-Level Charting?
Use group-level charts to help readers compare results within each report group.
Placing a chart in a group band makes it repeat for each group. A chart parameter and series filter ensure that each chart displays the matching group’s data. Without the filter, every region could display sales from the entire dataset.
This approach also works for reports grouped by department, employee, customer, or product category.
Before You Begin
To follow this example, download the attached DemoGroupChartSales.vdm file. It includes the demo data used in this article.
If you are using your own View, include these fields or equivalent fields from your data:
| Field | Purpose |
|---|---|
| Region | Groups the report and filters each chart. |
| SalesRep | Provides the chart’s categories. |
| SalesAmount | Provides the values to total for each sales rep. |
Save and run the VDM View, then open the Finished Reports Designer. Select Details from the data-source menu on the Home tab.
1. Group the Report by Region
- In the Group and Sort panel, click Add a Group.
- Select Region.
- Confirm that Show Header is enabled.
- Drag Region from the Field List into the Group Header to label each region.
- Increase the Group Header’s height to make room for the chart.
2. Place a Chart in the Group Header
- Drag a Chart from the toolbox into the Region Group Header, below the Region label.
- When the Chart Designer opens, click OK.
- Resize the chart as needed.
The chart must be inside the group band so it appears for each region.
3. Create the Chart Parameter
- Select the chart and open Chart Tasks.
- Open the Parameters collection.
- Click Add.
- Set Binding to VDMData – Details.Region.
- Keep the default name controlParameter1.
- Click OK.
The chart parameter receives the Region value from the current report group. Create this parameter on the chart itself.
4. Add and Bind the Bar Series
- Open Chart Tasks and click Run Designer.
- Click the + beside Series.
- Select Bar.
- Select the new series and open the Data tab.
- Assign SalesRep as the argument and SalesAmount as the value.
The series properties should show:
| Property | Field |
|---|---|
| Argument Data Member | Details.SalesRep |
| Value Data Members | Details.SalesAmount |
5. Calculate Total Sales by Rep
- Keep the Bar series selected and open Properties.
- Expand Qualitative Summary Options.
- Click the … button beside Summary Function.
- Select SUM.
- Choose Details.SalesAmount as the field to summarize.
- Click OK.
The resulting function should be:
SUM([Details.SalesAmount])
Use Qualitative Summary Options because the chart’s argument, SalesRep, contains text.
6. Filter the Series to the Current Region
- With the Bar series selected, find Filter String.
- Click its … button to open the filter editor.
- Add a condition.
- Select Details.Region as the field.
- Set the operator to Equals.
- Use controlParameter1 as the parameter value.
Confirm that the resulting expression is:
[Details.Region] = ?controlParameter1
The ? identifies the chart parameter. Do not surround the parameter reference with quotation marks. If you renamed the parameter, replace controlParameter1 with its actual name.
If the value box requires typed input, enter ?controlParameter1 and check the resulting expression to confirm it is a parameter reference rather than quoted text.
Click OK to close the filter editor, then OK to close the Chart Designer.
7. Preview and Save the Report
- Select Preview.
- Review the charts for multiple regions.
- Confirm that each chart displays only the sales reps belonging to that region.
- Confirm that the bars show each rep’s total Sales Amount.
- Save the Finished Report.
With the demo dataset, each region should display three sales reps. The chart values and bar heights will differ between regions.
The Chart Designer may display sample labels and values. Use the report’s Preview to verify the actual data and group filtering.
Troubleshooting
| Issue | What to Check |
|---|---|
| Every region displays the same chart data | Confirm that the series’ Filter String compares Details.Region to the chart parameter. |
| Charts are blank | Confirm that the parameter is bound to Details.Region and that the filter uses ?controlParameter1 without quotation marks. |
| Sales values are not totaled by rep | Confirm that Qualitative Summary Options uses SUM([Details.SalesAmount]). |
| A chart repeats for each sales record | Confirm that the chart is in the Region Group Header rather than the Detail band. |
| Required fields are missing | Save and run the VDM View, then reopen the designer and select the appropriate data source. |
Comments
0 comments
Please sign in to leave a comment.