SSRS Bullet List from an Array of Values

Thought I’d give this blogging thing a try; so here’s my first attempt at blogging a recent challenge I had in getting Reporting Services to display a bullet list from an array of values.

To get right down to it; say you wanted to convert the following list of skills into a bullet list:
Navigate to Report Properties > Code and copy the following code into the Custom Code box. If you need to customize it even further; I have no objection.

Public Shared Function SetBullet(ByVal Value As String, ByVal Delimiter As String) As String
‘ Declare and load array with Split FN using Delimiter parameter
Dim ListArray() As String
ListArray = Split(Value, Delimiter)
‘ Remove any ’empty’ values from array
Dim LastNonEmpty As Integer = -1
For i As Integer = 0 To ListArray.Length – 1
If ListArray(i) <> “” Then
LastNonEmpty += 1
ListArray(LastNonEmpty) = ListArray(i)
End If
ReDim Preserve ListArray(LastNonEmpty)
‘ Apply bullet html markup to the list array
Dim RetValue As String = “”
Dim x As String = “”
RetValue = “<ul>”
For Each x In ListArray
RetValue = RetValue + “<li>” + x + “</li>”
RetValue = RetValue + “</ul>”
Return RetValue
End Function

Back in the report, modify the expression for the field you want to apply bullets to and wrap the field with the following code:

=Code.SetBullet(Fields!Skills.Value, “~”)


The first parameter in the SetBullet function is the field (or custom hard coded values) to which you want to apply the bullet style.The second parameter is the delimiter used in your list of values.

The code will handle any ’empty’ entries and remove them from the list in case you have one too many delimiters applied side-by-side or at the end of your list.

Once you’ve applied the function to your field, you need to change the markup type to convert the contents to HTML.

Click inside the item to highlight your new expression. Once highlighted, right-click > Placeholder Properties.

Select the markup type to be ‘HTML – Interpret HTML tags as styles’. This is pretty much self explanatory.
…and voila! You got yourself a bullet list from an array of values.

Reporting Services doesn’t support a wide range of HTML code, but here are some documented features (per Microsoft):

The following is a complete list of tags that will render as HTML when defined as placeholder text:
  • Hyperlinks: <A href>
  • Fonts: <FONT>
  • Header, style and block elements: <H{n}>, <DIV>, <SPAN>,<P>, <DIV>, <LI>, <HN>
  • Text format: <B>, <I>, <U>, <S>
  • List handling: <OL>, <UL>, <LI>
Be careful with adding CSS attributes, as some may not work on all tags.
Here’s what Microsoft has to say about it.

Leave a Reply

Your email address will not be published. Required fields are marked *