Problem with parameter selected grouping: Fields!fee_l2.Value vs. Fields("fee_l2").Value (SSRS 2008)
Hi
I have a report with a grouping based on a parameter; i.e. group expression is =Fields(Parameters!RowGroup2.Value).Value .
This only works for certain values of the parameter 'RowGroup2'. For example, it doesn't work when the parameter value is "fee_l2"; the error given is "The Group expression used in grouping 'Group_2' returned a data type that is not valid". I get the same
error if I use the group expression =Fields("fee_l2").Value. However, if I use the expression =Fields!fee_l2.Value, it works fine.
I have tried the same thing with another value of the parameter: residence_region. In this case =Fields(Parameters!RowGroup2.Value).Value and =Fields!residence_region.Value work fine, but =Fields!fee_l2.Value =Fields("residence_region").Value gives the same
error.
The two fields have the same SQL data type (varchar(50)), but are held in separate tables. trying other values, those in the same table as 'fee_l2' behave in the same way as 'fee_l2' and those in the same table as 'residence_region' behave the same way a
s'residence_region'.
This method has worked fine for me in several other reports, and this one up to this point. I have been converting database views to tables for performance purposes, and it's during the process of updating the report to use the tables that this problem has
manifested itself.
Any thoughts on what might be the problem, or advice on how this should work so I can get to the bottom of it would be very welcome
Thanks
RayIf this post, or another, answers your question, please click the 'Mark as answer' button so others with the same problem can find a solution more easily.
July 4th, 2011 10:24am
Okay, this turns out to be a
PICNIC.
My SSRS expression, which was generating my SQL, was not correctly adding the selected fields to the query. In my defense, I'd argue that the error message could have been a bit more helpful; more like "This field is empty" than "This field is of the wrong
type"!
If this post, or another, answers your question, please click the 'Mark as answer' button so others with the same problem can find a solution more easily.
Free Windows Admin Tool Kit Click here and download it now
July 4th, 2011 12:11pm


