views:

591

answers:

2

I need to build a report that shows data in four grouped levels. The tricky part is: the actual fields to be displayed on those four levels are to be passed into the report as parameters.

My main issue right now is this: how can I tell a textbox on the report to not display the value of the parameter @X, but the value of the field by the name which is specified in parameter @X?

So if I pass in @X = 'Agent', I don't want to show 'Agent' on the report, but really

=Fields!Agent

but how can I do that? It seems to me that those value expressions are all pretty much hardcoded - is there a way to define

=Fields!(@X)

or something like that - show the field which corresponds to the name passed to the report in parameter @X ?

This is probably absolutely silly - but I'm hitting a brickwall right now and can't seem to find a way around it....

A: 

Is the source data for the report arranged in such a way that you could define a second datasource which looks up the field values for parameters 1-4 and returns them as a single row, to which you could then refer in the report using the first syntax?

=First(Fields!Param1.Value, "Param_Lookups")
Ed Harper
+2  A: 

It is

=Fields(Parameters!X.Value).Value

as specified here

Edited to be correct: I forgot once you use an = (expression) you have to address the parameter differently.

jimconstable
you're close - not 100% accurate, though :-)
marc_s
I fixed it now.
jimconstable