Web Designer
Get Started / Tutorial 5: Create Pivot Report / Tutorial 5.1: Create a Simple Pivot Report
In This Topic
    Tutorial 5.1: Create a Simple Pivot Report
    In This Topic

    A simple Pivot report contains a Tablix data region. This report uses the default row and column groups to display data.

    This tutorial guides you through the steps to create a simple Pivot report using Tablix data region.

    After you complete this tutorial, you will have a report that looks similar to the following.

    An Example for Simple Pivot Report

    Access the ActiveReports Web Designer

    Run the Web Designer sample (WebDesigner_MVC(Core)) that you can download from the following link:


    The Web Designer is opened in browser ready to create your reports. By default you have a Blank RDL Report.

    Bind Data to Report

    1. Connect to a data source.
      1. Go to Data tab and click Add next to Data Sources.
      2. In the Data Source Editor, fill-in the Name field as 'Orders'.
      3. Select Provider as 'JSON provider'.
      4. Select JSON Data Type as 'External File or URL'.
      5. Enter the following URL in JSON Document: https://demodata.grapecity.com/northwind/odata/v1/Orders
      6. Test the datsource connection and click Add.
    2. Add a dataset.
      1. Click Add Data Set next to the added data source.
      2. In the Edit Data Set dialog, fill-in a dataset name and enter the Query: $.value[*]
      3. Validate the query to obtain the bound fields and select OK to add the dataset.

    Create Report Layout

    Drag and drop Tablix data region Tablix Toolbar Icon onto the design area of the report.
    Dragging the Tablix data region onto the design area

    Bind Data to Tablix Data Region

    Let us now populate the Tablix data region with the data we want to visualize.

    We want the ship names to be displayed along the rows, order years along with the columns, and the total price corresponding to these.

    To assist us in designing the Tablix, we will utilize the Tablix Wizard. Bind the data and apply some quick layout options to style, organize data, and add totals for the data values using the Tablix Wizard.
    Dragging the Tablix data region onto the design area

    1. Click Dragging the Tablix data region onto the design areaon the top-right corner of the tablix data region to open the Tablix Wizard.
    2. On the Tablix Wizard, drag and drop the 'ShipName' field onto the Rows Groups area.
    3. Drag and drop the 'OrderDate' field on the Columns Groups area.
    4. Similarly, drag and drop the 'Freight' field onto the Values area, which is the body of the tablix. Note that the 'Freight' field changes to Count(Freight).
    5. Update the count value to Sum(Freight)to display the aggregate freight charges and set Currency to a desired format.
    6. In the Layout Options>Totals, select Totals for Column Groups to display the total freight charges for the order years.
    7. Click OK to save the changes.
      Tablix data region

    Manage Data

    In Tablix data region, you need to manage how a grouped data is rendered across the rows and columns. This is done by using Group Expressions as explained below.

    1. Modify the {OrderDate} expression to {Year(OrderDate)} to display only the 'Year' part of the date in the textbox of the column group.

      To display the order year once for every column group:  
    2. With the Tablix data region selected, go to the Group Editor Group Editor Icon to display row groups and column groups.        
    3. Select 'Tablix1_OrderDate_Group' column group and go to the Properties pane.

    4. In the Group Expressions property, click Show Items.
    5. Edit the expression to {Year(OrderDate)}.
    6. Update the textbox with 'Total' label to 'Total Freight Charges' .
      Tablix data region

    Add Report Title

    1. Drag and drop a TextBox control Textbox Toolbar Icon above the tablix. If required, relocate the tablix to create space for the text box.
    2. Click inside the text box and enter the text 'Shipments by Year'.

    Customize the Appearance of the Pivot Report

    Customized Pivot Report

    Preview and Save Report

    1. Click Preview Preview Button to view your report in the final output.
    2. Exit the preview mode by clicking Back on the top left side of the designer.
    3. Click Save to open the Save dialog box. Enter the report name and click Save Report.