Fields

The most basic type of expression, called a field expression, displays a field value in a text box. All fields used in the report from the chosen business object are displayed in the Fields List pane and you can use any of these in an expression.

Uwaga: One method of preparing to write a report is to undock the Fields tab and drag all the required fields from the Data Fields pane onto the Fields tab. Fields can then be dragged from the Fields tab directly onto the report canvas.

To link a business object field to a report item, you must include in the expression the Fields collection, the name of the field, and the Value property.

For example, to display an account code in a text box, use this expression:

=Fields!LedgerLine_accountCode.Value
Uwaga: The SunSystems Reporting Services field aliasing system can create quite complicated names for fields. To view a field's alias, drag the field to the report and view the Value property in the property pane.

An expression can be short, referring to a field object, or long to include decision functions or formatting based on fields or other report items. Expressions in report items and properties must begin with an equal character (=), otherwise the text is evaluated as a string.

Examples:

Here are some basic arithmetic and aggregate expressions

  • This concatenates the FirstName field and the LastName field.
    =Fields!FirstName.Value &" "& Fields!LastName.Value
  • This adds the Quantity and UnitPrice for a LineTotal
    =Fields!Quantity.Value*Fields!UnitPrice.Value
  • This performs a sum aggregation on the LineTotal field.
    =Sum(Fields!LineTotal.Value)
Uwaga: This is the equivalent of selecting the Summary Type of Total and Calculation Type of Sum (visible if numeric values are selected) from the Summary Field dialog.
Uwaga: You cannot use Aggregate functions in a Calculated Field expression.