Tuesday, February 28, 2012

How to show a section in a SSRS report based on a parameter?

Today, I got a question how you can display a section in a SQL Server Reporting Services (SSRS) report based on a parameter value. In this blog I will describe how you can achieve this. I will make use of a general ledger card as example. This general card will show financial entry information. Depending on the parameter value: CostAnalysis it will show costcenter information.

Photo credit: Nisha A

Example of general ledger card without costcenter information:
Example of general ledger card with cost center information:

How to achieve this?
  • Add a extra detail line in the report for the costcenter columns.
  • Add the costcenter columns to this detail line.
  • Add a parameter CostAnalysis to your report. In this example I will make the posibility to choose to display the costcenter code or the costcenter code + costcenter description.
  • Select Available Values, Specify values and Add 3 labels
  • Specify default value 0. So costcenters will not be displayed by default.
  • Select the costcenter detail line of the left. Right mouse click and select row visibility.
  • Select Show or Hide based on expression. Add next expression:
    =IIF((Parameters!CostAnalytics.Value=0) True,False)
    This will display the costcenter line if parameter value = 1 OR 2
  • In the costcenter columns we need to add logic to display only the costcenter code or the costcenter code + description. Select the costcenter column and add next expression to this column: =Fields!Costcenter.Value + IIF (Parameters!CostAnalytics.Value = 2, " - " + Fields!CostcenterDescription.Value, "")
    This will print the costcenter code and only the description in case the CostAnalytics parameter value = 2
In this way you can do the same for currency information etc.
Enjoy it to build nice customer experience reports.

1 comment:

pi7lmoxv6b said...

There was additionally a minimum of|no much less than} one try the place I barely obtained one in proper on the end. Opening Day of the horse-racing season features the most outrageous hat contest, Mint Juleps steal the show on the Kentucky Derby, and accordingly, lots of} attendees, primary target|the main focus} is on mingling instead of gambling. Research reveals that slot-machine seduction could have little to do with money. Bloomberg Markets European Open Bloomberg Markets European Open kick begins the buying and selling day, breaking down what's shifting 메리트카지노 markets and why. Francine Lacqua and Tom Mackenzie reside from London deliver you an action-packed hour of reports no investor in Europe can afford to overlook. Eventually, the complications of maintaining with Google Play caught as much as} the group.