[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications, and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Gantt Control
  [Expand]Chart Control
  [Expand]Map Control
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]PDF Viewer
   [Expand]Product Information
   [Expand]Getting Started
   [Expand]Graphical User Interface
    Supported Formats
   [Expand]Developer Guidelines
   [Collapse]Data Acquisition
     Data Source Wizard
     Snap Mail Merge
     Query Builder
     Master-Detail Relation
     Calculated Fields
   [Expand]Data Shaping
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Calculated Fields

This document describes how to use calculated fields to evaluate custom expressions based on external data, and embed the results into a Snap document.

The document consists of the following sections.

Expanded Add Calculated Fields

Use calculated fields to perform additional calculations on dynamic data and embed the results into a published document.

To create a calculated field and access its collection, invoke the context menu in the Data Explorer.

A calculated field with the default name (calculatedField1, calculatedField2 etc.) is created. Use Edit Calculated Fields... context menu to change the name and type of the field.


The field's name should begin with a letter or an underscore and contain only alphanumeric characters.

A calculated field's expression can include conditional, date-time, mathematical and other formulas. It can also evaluate the values of other calculated fields, data source fields and Parameters.

The Expression Editor is invoked by right-clicking a calculated field and choosing the Edit Expression… item in the invoked popup menu.

After a calculated field is inserted into a document, its value is evaluated each time the document is set to be published.

Expanded Create Calculated Fields in Code

Use the DataSourceInfo.CalculatedFields property to access the collection of CalculatedField objects in the data source. The IDataSourceOwner.CalculatedFields property provides access to the snap document's collection of calculated fields.

A calculated field's value is returned after evaluating an expression assigned to the CalculatedField.Expression property.

The following code illustrates how to create and customize a calculated field.

Expanded See Also

Is this topic helpful?​​​​​​​