0

I am able to conditionally group by a certain item in RDLC, but I'd also like the option to not group by anything. I'm not sure on how to do that.

Here's my current Group By expression:

<Group Name="GroupBy">
    <GroupExpressions>
      <GroupExpression>=iif(Parameters!GroupBy.Value = "C", Fields!City.Value, Fields!State.Value)</GroupExpression>
    </GroupExpressions>
</Group>

I have three group by options that I'd like:

If the value is "C", then group by City

If the value is "S", then group by State

If the value is "N", then don't group by anything

C1rdec
  • 1,647
  • 1
  • 21
  • 46
slygambit
  • 3
  • 1
  • 2

1 Answers1

1

Just add this statement and if it doesn't = C or S then group by some unique ID value.

=iif(Parameters!GroupBy.Value = "C", Fields!City.Value, iif(Parameters!GroupBy.Value = "S", Fields!State.Value, Fields!SomeUniqueValueUniqueToAllRecords.Value))

Hope that helps.

Cyberdrew
  • 1,832
  • 1
  • 19
  • 39