Suresh Veeragoni's Blog

A BizTalker's Blog

  Home  |   Contact  |   Syndication    |   Login
  21 Posts | 0 Stories | 32 Comments | 0 Trackbacks

News

Locations of visitors to this page
The Out Campaign: Scarlet Letter of Atheism

Disclaimer
The content of this site are my own personal opinions and do not represent my employer's/Microsoft view in anyway. In addition, my thoughts and opinions often change, and as a weblog is intended to provide a semi-permanent point in time snapshot you should not consider out of date posts to reflect my current thoughts and opinions

About
Suresh Veeragoni, working as a Principal Consultant at Sogeti USA LLC (A subsidiary of Capgemini SA Group), developing SOA & BPM solutions for Businesses using Microsoft CSD products (BizTalk, WF, WCF etc)

My Company

Sogeti




QR-Code for my Blog

qrcode

Tag Cloud


Archives

Post Categories

Consider you have a SQL Server Table with some multiline text data. And that data contains carriage return in it.

Now, if you want to display that data with carriage return in SSRS 2005 textbox, there is no direct way to display it.

Because SSRS 2005 uses VB engine to render the data, where it doesn’t understand line feed-->CHR(10) or Carriage Return -->CHR(13) characters.

So, what is the alternative?

Well, simple we need to use the Replace() function available and replace the specific characters with VbCrLf

 

ex:

=Replace(First(Fields!YourField.Value, "DataSource"),CHR(10),VbCrLf) –>This worked for me.

or

=Replace(First(Fields!YourField.Value, "DataSource"),CHR(13),VbCrLf)

 

In my case, The user was entering the data into SQL Server Database from an InfoPath form and wanted the carriage return to be persisted in the report. And in this case, CHR(10) worked instead of CHR(13).

Good to see SSRS 2008 added lot of rich text functionality, where you don't have to deal with these kind of silly things..,

Happy Reporting!

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati
posted on Wednesday, April 15, 2009 2:40 AM

Feedback

# re: Adding Carriage Return functionality to Textbox in SSRS 2005 5/7/2009 10:15 AM Linda
THANK YOU!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

# re: Adding Carriage Return functionality to Textbox in SSRS 2005 5/28/2009 3:29 PM Kenny
Wow, was just I was searching for!

Thank you very much!

# re: Adding Carriage Return functionality to Textbox in SSRS 2005 7/31/2009 12:51 PM TK
Thanks a lot This solved a lot for me

# re: Adding Carriage Return functionality to Textbox in SSRS 2005 8/24/2009 6:02 AM SL
Worked a treat

# re: Adding Carriage Return functionality to Textbox in SSRS 2005 10/20/2009 9:06 AM Mel
Hi there,

I used this on one of my textboxes but it adds line breaks for all my textboxes for some reason... any idea why?

# re: Adding Carriage Return functionality to Textbox in SSRS 2005 10/21/2009 1:30 AM suresh
Mel,
What exactly you are looking for?
carriage return or line break?

check the wiki for hex equivalent of both line feed/newline and carriage return. either of one should work

http://en.wikipedia.org/wiki/Newline

# re: Adding Carriage Return functionality to Textbox in SSRS 2005 12/8/2009 6:48 AM ernesto
hecks ya! thanks mucho!

# re: Adding Carriage Return functionality to Textbox in SSRS 2005 7/22/2010 2:00 AM max
Got the same problem in Visual Studio 2010 working with the newest Local Reporting(2008 R2).

Guess what this problem still exists.

But your posting helped me fixing it. Thank you big time!

# re: Adding Carriage Return functionality to Textbox in SSRS 2005 11/11/2011 1:20 AM ELAYA
Hi ,
How ro handle this into while export to excel from report .
while Export to excel ,its shows into single line .
how to split it up into two lines while Export

Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: