user1365247
user1365247

Reputation: 337

Access SSRS Field by its Unique Name

When writing an expression in SSRS, the syntax Fields!<FieldName>.Value is used to read the value that a particular field in a dataset row has.

Now I noticed that when you add a field to a dataset, not only does it have it's normal field name, but it also has associated with it a unique name, of the form [<Table>].[<FieldName>]

I would like to read the value of a field using its unique name rather than its field name. How can this be done?

For those who are interested, I need this because I am trying to pass a dataset filter as a parameter. One parameter will contain the field unique name to filter on, and the second parameter will contain the field value to match on in the filter. Whilst in my case the dataset field name can be changed, the unique name will not, so I must use this unique name

Upvotes: 0

Views: 1989

Answers (1)

Mike Honey
Mike Honey

Reputation: 15037

You can construct a dynamic field reference using syntax like this:

=Fields(Parameters!ParameterField.Value).Value

Ref http://msdn.microsoft.com/en-us/library/ms157328.aspx#Parameters

Upvotes: 2

Related Questions