ActiveReports 18 .NET Edition
Samples / Samples / API / Section Report / Cross Tab Report
In This Topic
    Cross Tab Report
    In This Topic

    The CrossTabReport sample displays hierarchical information in a cross tabular structure. This sample consists of a StartForm with an ActiveReports Viewer control and a ProductWeeklySales report.

    Cross Tab Report

    Sample Location

    Visual Basic.NET

    https://github.com/activereports/Samples18/tree/main/API/Section/CrossTabReport/VB.NET

    C#

    https://github.com/activereports/Samples18/tree/main/API/Section/CrossTabReport/C#

    Details

    When you run the sample, a report displaying a list of weekly sales for current week, month, quarter or year for each product category is displayed in the Viewer control. The values highlighted in red represent negative values.

    Note: To run this sample, you must have access to the Nwind.db. The NWIND.db file can be downloaded from GitHub: ..\Samples18\Data\NWIND.db.

    StartForm

    The Viewer control has the Dock property set to Fill. This ensures that the viewer resizes along with the form at run time. Right-click the form and select View Code to see the code used to run the report and display it in the viewer. ProductWeeklySales Report:

    ProductWeeklySales Report

    This report features a number of accumulated values using summary function property settings and calculated values in the code.The summary function displays a list of summary values only for weekly sales total in group footer without displaying the Detail section. By setting the Height property of Detail section to 0 and/or hiding the Detail section by setting Visible property to False, you can create a summary report that only displays sections other than the Detail section.
    Based on the order date of Detail section data, you can determine whether it will be included in a week, month, quarter, year or previous year's quarter and set the values by sorting in unbound fields. Value of each unbound field is automatically summarized by each Field placed in the group footer section.