Category / Section
How to Wrap Axis Labels in Chart Report Items in Bold Reports
Published:
Updated:
In Bold Reports, axis labels in chart report items can sometimes be too long, leading to overlap or truncation. To improve readability and presentation—especially when dealing with lengthy labels like movie titles, product names, or detailed descriptions—you can use a custom code modules to dynamically wrap axis labels.
Steps to Enable Axis Label Wrapping
- Drag and drop the chart report item onto the design surface and map the required fields according to your reporting needs.
- Click on the grey area of the Report Designer to access the “Report Properties”. In the “Code” section, add the following code module to handle label wrapping:
Function SplitText(input As String) As String
Dim words() As String = input.Split(" "c)
Dim result As String = ""
For i As Integer = 0 To words.Length - 1
' Add words to the result
result &= words(i) & " "
' Insert line breaks after the 2nd word, 4th word, and so on
If ((i + 1) Mod 2 = 0) Then
result &= "<br>"
End If
Next
' Return the modified string
Return result.Trim()
End Function
- Navigate to the group expression for the chart’s axis labels. Use the custom code module to wrap the labels. For example:
=Code.SplitText(Fields!Movie.Value)
- Save and preview your report. You’ll see that the axis labels are now wrapped dynamically based on the logic defined in the code module.
Output before adding code modules:
Output after adding code modules:
A sample report is attached here for your reference.