How to Split Long Text Across Two Columns in Bold Reports
Long text fields such as product descriptions, legal notes, comments, or statements can create tall and difficult-to-read report sections. Improve readability by displaying the content in two clean columns. This article explains how to split long text using a custom VB function, a Rectangle report item, and two TextBox report items.
This approach works in all Bold Reports versions and is suitable for invoices, contracts, and detailed reports.
Prerequisites
- Bold Reports Designer (web or desktop)
- A dataset field that contains long text (for example,
Fields!YourText.Value) - Basic knowledge of expressions and custom code
Step-by-Step Guide
1. Add the custom VB function
- Open your report in the Designer.
- Click the blank report canvas (outside any report item) to select the report.
- In the Properties panel, expand the Code section.
- Click Code to open the Code Module editor.
- Add the following function at the end of the code:
Function SplitText(ByVal input As String, ByVal part As Integer) As String
If String.IsNullOrEmpty(input) Then Return ""
Dim midPoint As Integer = input.Length \ 2
If part = 1 Then
Return input.Substring(0, midPoint)
Else
Return input.Substring(midPoint)
End If
End Function
2. Create the two-column container
- Drag a Rectangle report item onto the design surface.
- Drag two TextBox report items inside the Rectangle and place them side by side.
- Resize both textboxes to equal width and adjust the height as required.
3. Set the expressions
Configure the Value property for each TextBox as follows:
Left column (Textbox 1):
=Code.SplitText(Fields!YourText.Value, 1)
Right column (Textbox 2):
=Code.SplitText(Fields!YourText.Value, 2)
Replace YourText with your actual dataset field name.
4. Preview the report
- Click Preview.
- Verify that the long text appears in two columns.
How it works
The SplitText function determines the midpoint of the input string and returns either the first or second half. Placing both TextBox items inside a Rectangle maintains column alignment. The function runs during report rendering and supports dynamic data.
Tips and enhancements
- Word-aware splitting: Modify the function to split at the nearest space to prevent breaking words.
- Repeatable layout: Place the Rectangle inside a Tablix cell to apply the layout across multiple rows.
- Make split point configurable: Add a parameter to control the split position.
- Styling: Apply consistent formatting to both TextBox items.
Sample report
Download the sample report to test this functionality.