Answered by:
Add carriage return into a multiline textbox in report (SQl Reporting Service 2000)

Question
-
Hi,
I need to add carriage returns into a text box of 3 lines.
The data is pulled from the BD so the "cariage return" symbol need to be in the database field.
I know that some reporting software give the option to add HTML code into textbox but I did'nt find out about ms reporting 2000.
Thanks,
MarcoSaturday, October 6, 2007 12:59 AM
Answers
-
=First(Fields!string.Value).Replace("\r",VbCrLf) did not work for me.
But this did:
=First(Fields!string.Value).Replace(Chr(13),VbCrLf)- Proposed as answer by rgould Tuesday, September 8, 2009 9:31 AM
- Marked as answer by Lukasz Pawlowski -- MSMicrosoft employee Friday, September 11, 2009 4:32 PM
Friday, April 3, 2009 12:39 AM
All replies
-
SRS uses a VB engine for evaluating expressions. You can add a replacement command to the expression like this
Code Block=First(Fields!string.Value).Replace("\r",VbCrLf)
and you will get the cariage return you are wanting. In the example above, I embedded '\r' in the sql string returned as follows
Code Blockselect 'some\rtext\rfrom\rhere' as stringand when the report rendered, the text box contained
some
text
from
here
Good luck!
Sunday, October 7, 2007 3:22 AM -
Worked for me... thanks!Tuesday, March 25, 2008 7:26 PM
-
18 Months latter and the advice is still good.
Works a treat
Thanks !
Wednesday, February 11, 2009 5:49 PM -
=First(Fields!string.Value).Replace("\r",VbCrLf) did not work for me.
But this did:
=First(Fields!string.Value).Replace(Chr(13),VbCrLf)- Proposed as answer by rgould Tuesday, September 8, 2009 9:31 AM
- Marked as answer by Lukasz Pawlowski -- MSMicrosoft employee Friday, September 11, 2009 4:32 PM
Friday, April 3, 2009 12:39 AM -
For me, my database data contained carriage returns which I wished to reflect in an SQLRS text field...... Mister Kens answer was the right one to replace these carriage return characters in the database field to vb carriage returns for my text box.
Tuesday, September 8, 2009 9:33 AM