[]
This walkthrough creates a Clustered Column Chart. The chart consists of two columns comparing the 'Net Sales' and 'Net Income' per 'Product Category'. The final chart appears like this:
In the ActiveReports Designer, create a new RDLX report and follow the New Report wizard to bind the report to data. You can also perform data binding later using the Report Data Source dialog accessed from the Report Explorer.
Right click the added datasource and in the DataSet dialog, select the General page and enter the name of the dataset, 'FactSales'.
Go to the Query page and enter the following query to fetch the required fields:
$.value[*]
Go to the Fields page to view the available fields and modify the Name of the [SalesAmount] field to [Net Sales].
On the same page, add two calculated fields:
Name | Value |
---|---|
Net Income | =[Net Sales] - [UnitCost] - [DiscountAmount] - [ReturnAmount] |
Product Category | =Switch([ProductKey] < 116, "Audio", [ProductKey] >= 116 And [ProductKey] < 338, "TV and Video", [ProductKey] >= 338 And [ProductKey] < 944, "Computers", [ProductKey] >= 944 And [ProductKey] < 1316, "Cameras", [ProductKey] >= 1316, "Cell Phones") |
Click OK to save the changes.
We will use the Chart Wizard dialog to configure chart data values and basic customization. If you have a dataset added to your report, on Chart's drag-drop operation, the wizard appears. See the topic on Chart Wizard for more information. You can make further adjustments to the chart after you exit the wizard by accessing the properties of chart elements through dialogs, property panels, and adorners.
Drag-drop Chart data region onto the design area. The New Chart dialog appears with an option to select the query and the plot type.
Select the Query as the dataset name (FactSales) and the Plot Type as 'Column'.
Click Next to configure data values.
Here, we will define two series values to form a cluster (or group), one column to show the 'Net Sales' and the other to show the 'Net Income'.
Under Configure Chart Data Values, add the following two values from the drop-down, set the corresponding aggregates and captions, and click Next.
Field | Aggregate | Caption |
---|---|---|
[Net Sales] | Sum | Net Sales |
[Net Income] | Sum | Net Income |
In the Configure Chart Data Groupings, set the Categories > Group By to [Product Category]. Keep the remaining settings as it is. Ensure that Series > Layout Type is 'Cluster'.
Click Next and Choose Report Colors from Theme and Style, and preview your chart.
Now that the basic structure of your chart is ready, let us add more meaning to the chart using the properties via the Chart Panels, Adorners, and Property Panel.
You may want to resize the chart, change the chart palette, and customize other chart elements. Once you are done, press F5 to preview the report.
type=note
Note: We use stub data at design time and not real data. So to view the actual final chart, you need to view the chart on the preview.