Progress® Telerik® Reporting R3 2020

Creating the Graph

This article is part of the Demo report guide on getting started with Telerik Reporting and demonstrates how to create a Graph item in the Report Header.

The controls which the Report Header and the Report Footer contain are displayed only once at the top and bottom of the entire report respectively. The controls which the pageHeaderSection and the pageFooterSection are displayed on all pages. The Report Header and Report Footer are hidden by default.

  1. To reveal the report header, right-click outside the report and select Report Header.

  2. Add a new SQL Datasource component for the graph with the following query:

    P.Name AS ProductName, SOD.LineTotal / 1000 AS LineTotal,
    SS.Name AS StoreName,
    C.FirstName + ' ' + COALESCE (C.MiddleName, '') + ' ' + C.LastName AS SalesPersonFullName
    Production. Product AS P
    INNER JOIN Sales.SalesOrderDetail AS SOD ON P.ProductID = SOD.ProductID
    INNER JOIN Sales.SalesOrderHeader AS SOH ON SOD.SalesOrderID = SOH.SalesOrderID
    INNER JOIN Sales.Store AS SS             ON SS.CustomerID = SOH.CustomerID
    INNER JOIN Sales.SalesPerson AS SP       ON SP.SalesPersonID = SOH.SalesPersonID
    INNER JOIN HumanResources.Employee AS E  ON E.EmployeeID = SP.SalesPersonID
    INNER JOIN Person.Contact AS C           ON C.ContactID = E.ContactID
    WHERE     (YEAR(SOH.OrderDate) = 2002)
  3. Rename the datasource to graphDataSource.

  4. Click reportHeaderSection.

  5. Select Insert > Pie > graphDataSource.

  6. Drag StoreName to Series.

  7. Drag LineTotal to Values.

  8. Mark the graph to add the filtering and sorting functionalities. As a result, the top five stores from the database will be rendered.

  9. From the Group Explorer, click Filter and set the following parameters:

    • Expression: =Sum(Fields.LineTotal)

    • Operator: Top N

    • Value: =5

  10. From the Group Explorer, click Sorting and set the following parameters:

    • Expression: =Sum(Fields.LineTotal)

    • Direction: DESC

  11. From the Properties grid, select the Color Palette option to set specific colors for each bar series.

  12. Add the title of the graph.

Previewing the Result

Preview the result by clicking Preview > PrintPreview.

In the generated report, the Color Palette is set in the following way:

Color [A=255, R=0, G=105, B=104],
Color [A=255, R=88, G=168, B=35],
Color [A=255, R=137, G=203, B=42],
Color [A=255, R=34, G=181, B=115],
Color [A=255, R=32, G=176, B=212]
Report With Graph

Next Steps

Previous Steps

In this article
Not finding the help you need?