views:

17

answers:

1

I have built an RDL report and after rendering any tab characters contained within my returned data do not appear in the generated report. Is it possible to display tab characters? (Users want to have the basic formatting of their 'comments' field to appear.) Tabs added to the rdl itself are maintained, but those in the data seemed to be stripped out by the rendering engine.

A: 

The problem is that SSRS rendering it's output like HTML, which ignores consecutive whitespaces and treats tabs as single spaces.

Probably the best you can hope for is either to replace the tabs in your SQL query or replace them inline in your textbox. I had the same problem where I had certain HTML tags that needed to be stripped out and I had to do it using an inline replacement.

You should be able to replace the tab with non-breaking spaces. Probably the clearest replacement is:      

Your replacement will look something like:

=Replace(MyTable.FieldName, Chr(9), "     ")

If you were do to do it in SQL, it would look something like:

REPLACE(MyTable.FieldName, CHAR(9), '     ')

You can also look at http://stackoverflow.com/questions/34926/strip-html-from-string-in-ssrs-2005-vb-net for more examples on how to do inline replacement.

Aaron D
This is rendering in a report viewer control embedded in my desktop app, not the web control. My understanding is that it will render in GDI on the desktop. For the web, your approach would be just fine, but I'm looking for desktop.
tsupe
Did you try it?
Aaron D