ActiveReports Developer 7
Data Field Expressions Sample
See Also Support Forum
ActiveReports Developer 7 > ActiveReports Developer Guide > Samples and Walkthroughs > Samples > Section Report > Summary > Data Field Expressions Sample

Glossary Item Box

The DataFieldExpressions sample 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 Developer 7. 


ShowSample Location

ShowVisual Basic.NET

<User Folder>\ComponentOne Samples\ActiveReports Developer 7\Section Reports\VB.NET\Summary\DataFieldExpressions

ShowC#

<User Folder>\ComponentOne Samples\ActiveReports Developer 7\Section Reports\C#\Summary\DataFieldExpressions

ShowRuntime Features

When you run the sample, the DataFieldExpressionsReport appears in the Viewer control. The DataFieldExpressionsReport displays data, using the Fields collection from the OrderDetail class.

The report data under ExtendedPrice is calculated by the data field expression, specified in the DataField property of the txtExtendedPrice TextBox at the design time.

ShowProject Details

ShowStartForm

The Viewer control has its 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.

ShowDataFieldExpressionsReport

The DataFieldExpressionsReport is an unbound report that uses the field values from the OrderDetail file for displaying the report data.

ShowPageHeader section

This section contains one Label control with the note text and four labels with the names of the report data fields.

ShowDetail section

This section contains four textboxes that use the Fields collection values to display the report data. 

The DataField property of the txtExtendedPrice textbox in the Detail section demonstrates how to format your data field expression.

ShowOrderDetail

This file contains the class with data that is used in the fields of the report. When the report is run, the values of these fields are used to display data of the report.

The field values are bound to the fields in the DataInitilize event and the data is bound to the field values in the FetchData event of the DataFieldExpressionsReport.

See Also

©2014. ComponentOne, a division of GrapeCity. All rights reserved.