Reports for WinForms | ComponentOne
Working with C1ReportDesigner / Charting in Reports / Charts in Grouped Reports
In This Topic
    Charts in Grouped Reports
    In This Topic

    Reports for WinForms allows you to create reports with multiple groups. For example, instead of listing all products in a single flat report, you could group products by category. Each group has a header and a footer section that allow you to display information about the group, including titles and subtotals, for example.

    If you add a chart to a group header, the chart will display only the data for the current group. By contrast, adding a chart to the report header or footer would include all the data in the report.

    To illustrate this, here is a diagram depicting a report definition as shown in the report designer and showing the effect of adding a Chart field to the report header and to a group header:

    Report Header section

    A chart field here would generate
    only one chart for the entire report.

    The chart would show all the data
    in the report's data source.

    Page Header section

    Group Header section (CategoryName)

    A chart field here would generate
    one chart for each CategoryName value.

    Each chart would show all the data
    for the current CategoryName.

    Detail section

    Group Footer section (CategoryName)

    Page Footer section

    Report Footer section

    Continuing with the example mentioned above, if you added a chart to the group header and set the DataX property to "ProductName" and the DataY property to "UnitPrice", the final report would contain one chart for each category, and each chart would display the unit prices for the products in that category.

    The images below show screenshots of the report described above with the group headers, the charts they contain, and a few detail records to illustrate:


    The above chart shows unit prices for products in the "Beverages" category. The below chart shows unit prices for products in the "Condiments" category.

    DataX = "Product Name"
    DataY = "Unit Price"

    Because the chart automatically selects the data based on the scope of the section that contains it, creating charts in grouped reports is very easy.