BandedList Data Region for Free-form Bands
In This Topic
Let us create a report that shows yearly shipments for each country. To display a summarized shipment value for each country and year, we will use BandedList data region and add groups. The report connects to the 'Orders' JSON data available here.
The final report will look as shown.
Create a Report
In the ActiveReports Designer, create a new RDLX report.
If you are creating a new report in the Visual Studio Integrated Designer, see
Quick Start.
Bind Report to Data
As you create a new report, you can configure the report data connection in the Report Wizard. You can also access the Report Data Source dialog by right-clicking the Data Sources node in the Report Explorer and then selecting the Add Data Source option. See JSON for details.
- On the Choose Data Source Type screen of the wizard, select JSON and click Next.
- To specify JSON File Path, click the Browse button and navigate to the desired file on your system. This report uses the 'orders.json' sample data source that can be downloaded from the following URL:
https://demodata.mescius.io/northwind/odata/v1/Orders
- Click the Next option and configure the dataset by adding a valid query. Enter OrderdsDataset into the Name field and select the node from the data tree in the Path section to generate the path. The resulting query is displayed in the Query field.
- Click Next to proceed to the final screen of the Report Wizard.
- Review the summary of the report and click Finish to successfully add the report with the JSON data source.
Design Report Layout
- Drag and drop the BandedList control onto the report's designer.
- With the BandedList control selected, click the Property dialog link to open the BandedList dialog.
- Go to the Groups page and click Add.
- Set the Group on Expression to =Fields!ShipCountry.Value.
This will ensure that the data in the banded list is grouped based on the [ShipCountry] field.
- Again, click Add to insert another group.
- Set the Group on Expression to =Year(Fields!OrderDate.Value).
This will repeat the shipments by year for each country.
- Click OK to close the dialog. Group Headers and a Group Footers are added.
- From the dataset, drag the [ShipCountry] data field to the Group1 Header of the BandedList control.
- Drag and drop two Textbox controls onto the Group2 Header of the control and set their Value property as follows:
- TextBox1: =Year(Fields!OrderDate.Value)
- TextBox2: =Sum(Fields!Freight.Value)
- In the Properties pane, set the Format property for the [Freight] field to Currency.
- Again, drag and drop two Textbox controls onto the Group1 Footer of the control and set their Value property as follows:
- TextBox3: Total
- TextBox4: =Sum(Fields!Freight.Value)
- To add the report title, drag and drop the TextBox control to the PageHeader section and set its Value property to 'Yearly Shipments'.
- Improve the appearance of the report and preview.
See Also