Articles in this section
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

  1. Drag and drop the chart report item onto the design surface and map the required fields according to your reporting needs.
  2. 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:

image.png

image.png

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 
  1. Navigate to the group expression for the chart’s axis labels. Use the custom code module to wrap the labels. For example:

image.png

image.png

=Code.SplitText(Fields!Movie.Value) 
  1. 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:

image.png

Output after adding code modules:

image.png

A sample report is attached here for your reference.

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied