Monday 13 October 2014

SQL Server Reporting Services - Creating Professional Tool Tips

Creating tools tips in SSRS charts is very straightforward, simply right click on the series in the chart and then select Series Properties.




Then you can choose one of the fields in the data set as the tool tip using the drop down arrow.




This gives quite basic information but you can create a more customised tool tip using the fx button. Once you are in the function section you can


  • Add labels
  • Include the position on the X or Y axis
  • Show multiple pieces of information on separate lines
  • Format numbers using commas or decimal point accuracy



The code to achieve this is

="Channel: " + Fields!Channel.Value & VbCrLf + "Day" + ": "  + Fields!DayNameOfWeek.Value &  VbCrLf  + "Orders" + ": " +  FormatNumber(CStr(SUM(Fields!Tickets.Value)), 0)


The spaces between the lines can be created by & VbCrLf

When using numbers you must cast it as a string using CStr() around the field value. By wrapping the string with FormatNumber( , 0) you can format the way a number appears. This will include a comma between thousands and not include any decimal places. If you change the 0 to 2 you will include two decimal places.

All of the strings can be concatenated together using the + character. Labels can be created by enclosing text in between quotation marks.