Dean Flaherty Dean Flaherty - 1 year ago 89
SQL Question

SSRS - Line break in Matrix cell

In a SSRS Matrix cell I want to be able to have a line break between each output given.

I have the following code in my MS SQL Server Stored Procedure which I then point my SSRS report to

SELECT Customer, Hostname, (QName + QHostname + Qtag + QSerial + QCategory + QType + QItem + QManu + QModel + QVersion) AS AdditionalInfo1

At the moment in the AdditionalInfo1 cell when one of the options is returned they are separated by a comma


QName, QHostname, Qtag.

Instead I would like them to be separated by a line break all within the same cell





I have tried putting + char(13) + between each Q... in AdditionalInfo1 but this didn't work.

Answer Source

For SSRS, you want to use Chr(10), not Chr(13). I've used this in expressions and as a Join delimiter argument and it produced the desired effect: line breaks within the textbox.


Below is an expression that will return an empty string if the field value (QHostName) is null, or the value preceded by a newline if it is not.

IIF(ISNOTHING(Fields!QHostname.Value),"", vbCrLf + Fields!IQHostname.Value)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download