ActiveReports 14
ActiveReports 14 User Guide / Samples and Walkthroughs / Samples / Samples / API / Section Reports / 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. 

    Sample Location

    Visual Basic.NET

    ..\Samples14\API\Section\Summary\VB.NET

    C#

    ..\Samples14\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 of ActiveReports 14.

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

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