Sunday, October 2, 2016

Format report based on conditions (SSRS) (Part1)

  • Bind the data set to the report.



  • Select the "Font" text box and set font properties as follows.




[code] =iif(Fields!Font.Value = "B","Bold",iif(Fields!Font.Value = "BU","Bold",iif(Fields!Font.Value = "BUU","Bold","Normal"))) [/code]


  • Select the  "Balance" text box and set Border style properties as follows.


Top 
[code] =iif(Previous(Fields!Font.Value) ="BUU","Double","Solid") [/code]

Bottom
[code] =iif(Fields!Font.Value = "BUU","Double","Solid") [/code]


  • For the double lines, set Border width properties as follows.


Top 
[code] =iif(Previous(Fields!Font.Value) ="BUU","3pt","1pt")[/code]

Bottom
[code] =iif(Fields!Font.Value = "BUU","3pt","1pt") [/code]


  • Result will be like this.



  • You can see that the bottom row also should have double lines as the font is "BUU", but there is only a single line. Just simply add an extra row below the table. 


Tip: When there are double lines ,
MSDN thread suggests a few requirements to get this running:

  1. The border width must be 3pt at least.
  2. There must be at least one row beneath the Double border text box.
One more note - this is not required for Excel - just add a 1pt Double border and it will be fine. The above series of steps are only required for Web, PDF, etc.

No comments:

Post a Comment