ComponentOne FlexReport for WinForms
Calculated Field
Working with FlexReportDesigner > Adding FlexReport Fields > Calculated Field

In order to create fields that do not use raw data, Calculated fields are the best option. Calculated fields contain expressions that are evaluated at run-time. They are used to generate those data values that are not stored in the data base.

Some predefined expressions are available in the dropdown of Calculated Fields.

To add a predefined Calculated field using FlexReportDesigner application:

  1. Create a new FlexReport in C1FlexReportDesigner.
  2. From Insert tab, add two Calculated fields - 'Date Created' and 'Page n of m', in the PageFooter section:

  3. Note the expressions in these calculated fields in the design area.

  4. Preview the report.

To define a Calculated field and add the field in the FlexReportDesigner application:

  1. Create a new report.    
  2. Bind the report with 'Orders Details' Table.    
  3. In Group Header, add a Text field 'Total' to display label for the total price.
  4. Go to Data tab, and right-click the Main data source and select Add Calculated Field. VBScript Editor appears.
  5. In the VBScript Editor, write the following expression:

    Quantity*UnitPrice

  6. Drop the above mentioned Calculated field as shown.

  7. Preview the report.