Thursday, October 27, 2016

Format report based on conditions (SSRS) (Part2)


  • Assume that there are multiple datasets, and we want to do a calculation in a textbox using multiple values from multiple datasets.


  • Add a textbox to the report, and write the expression as fallowing.
[code]
=First(Fields!StartersIssueValue.Value, "StartersIssue")- First(Fields!StartersReturnValue.Value, "StartersReturn") -First(Fields!StartersClosingValue.Value, "StartersClosing") [/code]

  • When getting the total of a particular value, it can be written like this.

[code] =Sum(Fields!Value.Value, "Cost") [/code]

Change the background color based on a condition



  • Select the table row and set background properties  as follows.


[code]
=SWITCH(Fields!Font.Value ="1B", "#dcf9db",Fields!Font.Value ="1N", "#dcf9db", Fields!Font.Value="2B", "#cee9c3",Fields!Font.Value="2N", "#cee9c3")
[/code]
  • Result will be like this.

Data Driven Colored Text for Reporting Services Reports

No comments:

Post a Comment