Using SSRS 2008.
I have a dataset containing 2 columns of data, Vendor and State. The same vendor can be in multiple states and states can of course contain multiple vendors. I want to group the report by either vendor or state, depending on which the user selects.
I set up a visible parameter called GrouBy. The valid choices for this parameter are "Vendor" or "State". The default is "Vendor".
I have a 2 column table displaying Vendor and State. I created a parent group by right clicking and add group>parent group. In the expression for the parent group I have the following:
=IIF(Parameters!GroupBy.value=”Vendor”, Fields!Vendor.Value, Fields!State.Value)
When I preview the report I get the error: "The Group expression used in grouping 'Group1' returned a data type that is not valid'
Any idea what I'm doing wrong?