SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Prevent repeating space characters from being stripped from rendered report?


Prevent repeating space characters from being stripped from rendered report?

Author
Message
Truckin
Truckin
SSC-Enthusiastic
SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)

Group: General Forum Members
Points: 132 Visits: 127
I think this might just be an IE issue, but I am at a loss to control it and it is impacting reports with position sensitive strings.

A simple example - create a report from this simple sql statement. Deploy and look at the output in a web browser (I am using IE7).

select space(4)+'1' as str_len5


And maybe try this: add a column to the report layout with row value as

=Len(reportitems!str_len5.Value)


Open report in browser, for me, the '1' character is left justified, yet the length is reported as 5 characters. It trims in the middle of strings too:

select 'B'+space(4)+'1' as str_len5


(redeploy) and report displays 'B 1' for me.
Tried to export original report to xml and to csv, then I used notepad to open the xml and finding str_len5 shows <Detail str_len5=" 1" in the notepad window. Opening same xml in ie7 shows <Detail str_len5="1"

Is it possible to prevent repeating space characters (white-space) from being stripped from rendered report?
Lowell
Lowell
One Orange Chip
One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)

Group: General Forum Members
Points: 28622 Visits: 39977
isn't it an html issue, where html does not respect whitespace, carriage returns, line feeds or tabs?
so you need to replace spaces with & n b s p ; or char(160) to get the layout desired?

Lowell

--
help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Truckin
Truckin
SSC-Enthusiastic
SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)SSC-Enthusiastic (132 reputation)

Group: General Forum Members
Points: 132 Visits: 127
This function in the textbox worked. & n b s p did not work in the place of
chr(160).

=Replace(Fields!str_len5.Value, " ", Chr(160))

Thanks this solved the problem, put me on the right track.
:-)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search