ActiveReports 17 .NET Edition
Report Authors: Designer Components / Design Reports / Design Page/RDL Reports / Tutorials: Report Controls in Page/RDL Reports / BandedList Data Region in Reports
In This Topic
    BandedList Data Region in Reports
    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.

    Report with List Control

    Create a Report

    In the ActiveReports Designer, create a new RDL report. 

    Bind Report to Data

    Connect to a Data Source

    1. As you create a new report, the Report Data Source dialog appears for you to configure the report data connection. You can also access this dialog by right-clicking the Data Sources node in the Report Explorer and then selecting the Add Data Source option.
    2. In the dialog, select the General page and enter the name of the data source.
    3. Under Type, select 'Json Provider'. 
    4. In the Connection Properties tab, set the type of Json data to 'External file or URL'.
    5. In the Select or type the file name or URL field, enter the following URL:
      https://demodata.mescius.io/northwind/odata/v1/Orders

      The Connection String tab displays the generated connection string as shown below:
      Connection String
      Copy Code
      jsondoc=https://demodata.mescius.io/northwind/odata/v1/Orders
      
      For more information, see the JSON Provider topic.
    6. Verify the generated connection string by clicking the Validate DataSource Validate Icon in Report Data Source Dialog Box icon.
    7. Click OK to save the changes and close the Report Data Source dialog.

    Add Dataset

    1. Right-click the added data source and select Add Dataset.
    2. In the Dataset dialog, select the General page and enter the name of the dataset, 'OrdersDataset'.
    3. Go to the Query tab and enter the following query to fetch the required fields:
      Dataset Query
      Copy Code
      $.value[*]

    Design Report Layout

    1. Drag and drop the BandedList control onto the report's designer.
    2. With the BandedList control selected, click the Property dialog link to open the BandedList dialog.
    3. Go to the Groups page and click Add.
    4. 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.
    5. Again, click Add to insert another group.
    6. Set the Group on Expression to =Year(Fields!OrderDate.Value).
      This will repeat the shipments by year for each country.
    7. Click OK to close the dialog. Group Headers and a Group Footers are added.
    8. From the dataset, drag the [ShipCountry] data field to the Group1 Header of the BandedList control.
    9. 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)
    10. In the Properties pane, set the Format property for the [Freight] field to Currency.
    11. 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)
    12. To add the report title, drag and drop the TextBox control to the PageHeader section and set its Value property to 'Yearly Shipments'.
      Sample BandedList Design
    13. Improve the appearance of the report and preview.
    See Also