0

I have a report that has a collection of many gauges arranged in a grid. The row of data that each gauges references is different based on the parameters used to run the report. To accomplish this, I code each gauge individually to reference a specific row number from the data set. For example, the gauge in "position" 1,1 (first row, first column) has references to "RowNumber" 1 and uses the lookup function to find the corresponding data needed to drive the gauge. The gauge in "position" 1,2 has reference to "RowNumber" 2 and so and so on.

My question: is there a way to avoid hard coding these references? For example, this is the label expression for the gauge in position 1,1:

=LOOKUP(1,fields!RowNumber.Value,fields!TestCase.Value,"main")

As you can see, the "1" is hardcoded. I'm hoping to learn of a method where the expression would be more like:

=LOOKUP([gaugeReference!SomeAttribute],fields!RowNumber.Value,fields!TestCase.Value,"main")

...thus making all the expressions used inside the gauge reusable, no longer requiring hard coding. I was initially hoping that I could name the gauges "1","2","3", etc. and then reference that name in the expression, meaning I would only need to change the name and then everything else would adjust automatically.

nicbjones
  • 35
  • 4

1 Answers1

1

If it's just the row number you need (assumes the columns will always reference the same data based on their position) then it might be easier to create a dataset containing a record for each row for example

SELECT 1 as RowNum UNION SELECT 2 UNION SELECT 3 UNION SELECT 4... UNION SELECT 10 etc.

You can then create a tablix with a single row based on this dataset and reference

Fields!RownNum.Value

Alan Schofield
  • 19,839
  • 3
  • 22
  • 35