Share via

Using Common Function and Assembly References (Reporting Services)

Reporting Services provides a set of built-in functions that you can include in an expression. Built-in functions include Microsoft .NET Framework common language runtime (CLR) classes and Visual Basic run-time library functions. For convenience, you can view the most commonly used functions in the Expression dialog box, where they are listed by category: Text, Date and Time, Math, Inspection, Program Flow, Aggregate, Financial, Conversion, and Miscellaneous. Less commonly used functions do not appear in the list but can still be used in an expression.

You can also include references to classes in an external assembly. Classes in an external assembly do not appear in the Expression dialog box; you must provide the correct name for the class. .

Including References to Commonly Used Functions

Use the Expression dialog box to view a categorized list of common functions built-in to Reporting Services. When you expand Common Functions and click a category, the Item pane displays the list of functions that you include in an expression. The common functions include classes from the .NET Framework System.Math and System.Convert namespaces and Visual Basic run-time library functions. To use a built-in function, double-click the function name in the Item pane. A description of the function appears in the Description pane and an example of the function call appears in the Example pane. In the code pane, when you type the function name followed by a left parenthesis (, the IntelliSense help displays each valid syntax for the function call. For example, to calculate the maximum value for a field named Quantity in a table, add the simple expression =Max( to the Code pane, and then use the smart tags to view all possible valid syntaxes for the function call. To complete this example, type =Max(Fields!Quantity.Value). 

For more information about each function, see System.Math, System.Convert, and "Visual Basic Run-Time Library Members" on MSDN.

Including References to Less Commonly Used Functions

To include a reference to other less commonly used CLR namespaces, you must use a fully qualified reference, for example, System.Text.StringBuilder. Intellisense is not supported in the code pane of the Expression dialog box for these less commonly used functions.

For more information about each function, see "Visual Basic Run-Time Library Members" on MSDN.

Including References to External Assemblies

To include a reference to a class in an external assembly, you must identify the assembly for the report processor. Use the References page of the Report Properties dialog box to specify the fully qualified name of the assembly to add to the report. In your expression, you must use the fully qualified name for the class in the assembly. A fully qualified name includes the namespace, the class name, and the member name. For more information about adding a reference, How to: Add an Assembly Reference to a Report (Reporting Services).