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

    This sample shows how to use calculated fields and data field expressions for simple calculations in a report. 

    Summary Report

    Sample Location

    Visual Basic.NET

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

    C#

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

    Details

    When you run this sample, The Viewer control with the Select Report drop-down list is displayed. There, you can select one of the two reports - OrdersReport or DataFieldExpressionsReport, and click the Load Report button to display the report in the Viewer.

    The OrdersReport shows how to use calculated fields, where the field values are calculated in code. A custom field is added to the Fields collection in the DataInitialize event and the field value is calculated in the FetchData event. 

    The DataFieldExpressionsReport demonstrates the use of data field expressions for simple calculations within the same section of the unbound report using known Fields collection values. These data field expressions cannot be used with the built in summary functions.

    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.

    The sample consists of the StartForm and two reports - OrdersReport and DataFieldExpressionsReport.