May 5, 2011 at 2:35 pm
Hi,
I am supposed to display Hirerachical data in SSRS
Example:
Description
Captain
Lieutenant
Sergeant
Corporal
Private
And for that I did: = replace(First(Fields!Row_Description.Value), " ", " "). The Description columns shows hirerarchical data perfectly fine in PREVIEW in Microsoft Visual Studio 2005.
HOWEVER
When I deploy the same report on actual site, description column looks like:
Description
Captain
Lieutenant
Sergeant
Corporal
Private
Any Idea why would that happen??
Thanks
May 5, 2011 at 2:37 pm
an HTML report ignores whitespace...so to handle that, you'd probably want to .Replace " ", "& n b s p ; " or with CHAR(160) which is a space in most fonts, but not ignored by HTML.
Lowell
May 5, 2011 at 5:28 pm
Ok! this is what i did
Step 1: I cast Row_Description column as char(160)
step2: I add this expressions: = replace(First(Fields!Row_Description.Value), " ", "& n b s p ; ")
Now I am getting following result:
& n b s p ; "& n b s p ; "Operating"& n b s p ; ""& n b s p ; "Maintenance"& n b s p ; ""& n b s p ; "
Thank you
May 6, 2011 at 5:44 am
is the html symbol for non breaking space.
the forum here will convert into the html space...so you wouldn't see what i was talking about. i had to add extra spaces to it or fully html-escape it so it would not get converted to html by the forum . sorry i thought it was obvious.
try either of these two and let me know if that works for you:
--remove teh space after the ampersand
= Replace(First(Fields!Row_Description.Value), " ","& nbsp;")
= Replace(First(Fields!Row_Description.Value), " ", Chr(160))
it took me EIGHT edits to get this to kinda display. using an html forum to describe html tags is hard.
Lowell
May 11, 2011 at 12:45 pm
Thank you Lowell
This works 🙂
--------------------------------------------------------------------------------
June 11, 2011 at 6:47 am
HI,
When I have a html string in my DB with "" to print leading where I expect the output to be like the one below:
Description : Smear studied shows parabasal cells with few neutrophils in background.
There is no evidence of specific infection, dysplasia and malignancy in smear
studied.
Insteads it renders like this:
Description : Smear studied shows parabasal cells with few neutrophils in background.
There is no evidence of specific infection, dysplasia and malignancy in smear studied.
Can anyone help please...
June 11, 2011 at 7:48 am
you need to replace vbCrLf with the html break tag <br /> & vbCrLf, whether in the data source at SQL, or in the textbox/panel you are loading the data into on the report.
HTML does not repsect whitespace...tabs, carriage returns, or more than one space in a row are all converted to a single space character.
formatting is done with tags or special escape characters, as mentioned above.
Lowell
Viewing 7 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply