SSRS: Multiple Ways to Split a String into Multiple Lines

SSRS: Multiple Ways to Split a String into Multiple Lines

This post is about how to split a string inside textbox or field into multiple lines .

Below are the options to split a string into multiple lines :

i.) using VBCRLF
ii.) using chr(10)
iii.) using <br> HTML tag

Consider for example that I have a string "Microsoft Reporting Tool - SQL Server Reporting Services" inside a textbox ,
  and we want to split the string into two lines inside textbox as shown below :

"Microsoft Reporting Tool -
SQL Server Reporting Services"

 --Using VBCRLF : 

="Microsoft Reporting Tool -"+ VBCRLF +"SQL Server Reporting Services"

--Using chr(10) : 

="Microsoft Reporting Tool -"+ chr(10) +"SQL Server Reporting Services"
--Using HTML tag <br> :
="Microsoft Reporting Tool - <br> SQL Server Reporting Services"

To add expressions using VBCRLF and chr(10), just right-click on textbox - > Expression (fx)

To add expression using HTML tag <br> - > click inside textbox - > Create Placeholder ... - > Placeholder properties - >
General - > value - > Expression (fx)
and also in the same window, select the option
HTML -  Interpret HTML tags as styles

Leave a Comment
  • Please add 2 and 7 and type the answer here:
  • Post
Wiki - Revision Comment List(Revision Comment)
Wikis - Comment List
Sort by: Published Date | Most Recent | Most Useful
Posting comments is temporarily disabled until 10:00am PST on Saturday, December 14th. Thank you for your patience.
  • Because this article missed the July competition (it wasn't added in time), we'll submit it for the August competition:

  • * The vbCrLf is just a "hard-coded" base on old VB command for CR+LF (Carriage Return and + Line Feed), there for VB+Cr+Lf => vbCrLf.

    * LF - char Line feed, '\n', 0x0A, 10 in decimal. there for by adding char(10) you just add LF.

    * Microsoft windows operation system use the option CR followed by LF as "a newline" marker. there for adding just char(10) as written, might make you data inconsistent with some windows application like the notepad. You should add char(13)+char(10) and not just char(10) for consistent.

    * CR - Carriage return, '\r', 0x0D, 13 in decimal

    ** In summary first option of adding vbCrLf is equivalent to second option adding char(13)+char(10), it is just like saying the same word in two different languages (the translation of HELLO is always HELLO).

    ** different operation systems use different NewLine's marker. Unix-like systems use only char(10) for example.

    check this link for more

Page 1 of 1 (2 items)