Thursday, March 27, 2014

SSRS – Hide Rows in a Group based on a Value

SSRS – Hide Rows in a Group based on a Value

If you want to hide rows in a group based on a value in Reporting Services, it is pretty easy to accomplish.  You can do this using an expression, but you will need to add in another expression to get the toggle icon to display correctly.
  1. Click on the Tablix.
  2. Right-Click on the Row Group and select Visibility…
  3. Select Show or hide based on an expression.
  4. Select Display can be toggled by this report item: [Select Column Name]
  5. Click the fx button.
  6. Use an expression such as:
    1=IIF(Fields!YourField.Value like "*YourValue*",true,false)
  7. Click Ok (twice)
If you run the report now, you will notice that the rows in the group you specified will be hidden, but the toggle +- icons will be incorrect.
To fix this:
  1. Click on the textbox that contains the drill down.
  2. Select the InitialToggleState | Expression.
  3. Use an expression such as:
    1=IIF(Fields!YourField.Value like "*YourValue*",false,true)
    *Notice the false/true is opposite of the first expression.
That should be all there is to hide rows in a group based on a value.  If you have any questions or comments, feel free to comment below.

How to Implement/show Currency Symbol in SSRS Report.

 How to show Currency Symbol in SQL Server Reporting (SSRS):
1>Create a table called "Currency" with column [Currency Name],[Rate] and later join Currency table with your primary table in while creating data set in Report.
 2>Right Click Text box property--> Number-->Custom -->Custom format-->Paste below code in expression field.
3>Red color symbol display for  negative value .
4>Currency Symbol:
$ :US Dollar
AUD :Australian Dollar
€ : Euro
£ : Pound
¥ :Yen
Y:Yuan

=IIF(
Fields!Currency.Value="USD","'$' #,0;('$' #,0)"
,IIF(Fields!Currency.Value="AUD","'AUD' #,0;('AUD' #,0)"
,IIF(Fields!Currency.Value="EUR","'€' #,0;('' #,0)"
,IIF(Fields!Currency.Value="GBP","'£' #,0;('£' #,0)"
,IIF(Fields!Currency.Value="JPY","'¥' #,0;(''¥' #,0)"
,IIF(Fields!Currency.Value="CNY","'Y' #,0;('Y' #,0)"
,"Error"))))))