Using expressions for properties
Without realizing it, you might have already used expressions when designing reports. This is because, most of the time, expressions are implicitly created when you design the layout of your report. For example, when you drag and drop a field on a textbox, the system creates the following expression for the Value
property of the textbox:
=Fields!ColumnName.Value
The expression gives the instruction to fetch the Value
property from the dataset Field
with the name ColumnName
. Fields is actually a collection that holds all of the fields in the dataset. There are other collections that you can use.
For example, if you right-click on a textbox and select Expression..., you will end up in the expression designer for the Value
property of that textbox, as shown in the following screenshot:
In the preceding screenshot, a field is dragged onto a textbox. In the textbox in the Tablix, it says, [Description_Item]
. When you drag or select a field from the dataset into a...