Data Dynamics Reports offers five Global Collections for use in expressions:
- Globals
- Parameters
- Fields
- ReportItems
- User
You can access any of the global collections using Microsoft Visual Basic® .NET collection syntax, for example:
- Collection!ObjectName
= User!Language
- Collection.Item("ObjectName")
= User.Item("Language")- Collection("ObjectName")
= User("Language")
The Globals, Parameters, and User global collections also support Visual Basic® .NET property syntax, for example:
- Collection.ObjectName
= Globals.PageNumber
The Globals and User collection members are of the data type variant. If you need to use a specific data type, use casting. For example,
CDate(Globals!ExecutionTime)
Here are the five collections, and their uses:
Globals
There are nine global variables available for use in expressions:
- Page N of M - gets both the current page and the total number of pages in the report.
- Page N of M (Section) - gets both the current page and the total number of pages in the report section.
- PageNumber - gets the current page number in the report.
- PageNumberInSection - gets the current page number in the report section.
- TotalPages - gets the total number of pages in the report.
- TotalPagesInSection - gets the total number of pages in the report section.
- ExecutionTime - gets the amount of time it took the report to execute.
- ReportFolder - gets the name of the folder containing the report.
- ReportName - gets the name of the report.
![]() |
Note: Page N of M and Page N of M (Section) are not distinct expressions themselves but are rather constructed from other expressions. They can be chosen using the Expression Editor or the Field Selection Adorner in a Textbox control located in the Page Header or Page Footer of a report. |
Example:
= Globals!ReportName
Parameters
All Report Parameters are available for use with queries, filters, and expressions. There are two properties on the Parameter object:
In a report item property, you can check the current Value of a parameter to decide whether to change a background color or hide a textbox. The following example, when used in the BackgroundColor property, makes the Bevarages report AliceBlue, but leaves reports on all other categories Transparent.
Example:
=iif( Parameters!CategoryID.Label = "Beverages", "AliceBlue", "Transparent")
Fields
Each dataset in your report contributes a Fields collection. All fields in these collections are available for use in expressions. There are two basic properties on the Fields object:
- Value - returns the current value of the field. If the same field name exists in multiple collections, the report looks to context to determine which collection to use. In a data region, it uses the associated dataset. In an aggregate expression, it uses the dataset for the scope.
- IsMissing - indicates whether the field is present in the dataset.
![]() |
Note: Some data providers allow additional properties which you can access using the collection syntax. |
Example:
= Fields!LastName.Value + ", " + Fields!FirstName.Value
ReportItems
Every report item in your report is available for use in expressions. There is one property on the ReportItems object:
- Value
Example:
= ReportItems!textbox1.Value
User
There are two user variables available for use in expressions:
You could use the UserID to retrieve user preferences or to grant or deny access to certain data. The Language can be used to determine time and date or currency formats. Unless you also have a conversion process in place though, it is best not to use the Language to determine currency formats so that you never end up with an invoice that should charge $5 but actually charges ¥5 (about four and a half cents).
Example:
= iif (User!Language = "en-US", "My fellow American", "Dear Madam or Sir")
