SSRS COLON / LINE TERMINATOR Expression Error

I am getting a weird expression error in SSRS.
The error is weird because it reports a COLON is invalid, but that only occurs after a few of them. on the 4th one??

Here is the error…
The Value expression for the textrun ‘Textbox14.Paragraphs[0].TextRuns[0]’ contains a colon or a line terminator. Colons and line terminators are not valid in expressions.

Here is the code…


=Switch(
First(Fields!Company.Value, "ARForm") = "C1",
"Payment Details: " & chr(10) & "Account Name: XXX",
First(Fields!Company.Value, "ARForm") = "C4",
"Payment Details: " & chr(10) & "Account Name: XXX",
1,"")

i’ve searched the world over and found nothing useful.
just wondering if anyone has gotten a similiar error and resolution.

thanks

Try pulling out the text from textbox 14 and drop it into a program like notepad++. Turn on show all symbols and then you can see if there is a weird hidden symbol stuck in your textbox. This often happens when people copy/paste things from weird sources like pdfs, websites, forms, or other documents.
Good luck!
Nate

1 Like

=Switch( First(Fields!Company.Value, "RForm") = "C1", "Payment Details: " & chr(10) & "Account Name: XXX", First(Fields!Company.Value, "ARForm") = "C4", "Payment Details: " & chr(10) & "Account Name: XXX", 1=1, "")

Hard to know for sure but the code you pasted had an odd " that could cause your error. Please try this code with the ``` preceding it.

If you look you will see the correct quote in front of the & chr(10)'s and bad for SSRS expression quotes on the other items

3 Likes

Good eye, @CSmith!

1 Like

Actually BOTH of you are the winners!!!

There was an odd Apostrophe and I was able to view that in an editor. Although It is weird how the error did /did not show when I added / removed ONLY the COLON from the expression, several times. :crazy_face:

image

Anyhow, all is right with the SSRS world now.
thank you both for your help

2 Likes

thats-fing-teamwork

1 Like