Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Prevent repeating space characters from being stripped from rendered report? Expand / Collapse
Author
Message
Posted Tuesday, March 24, 2009 6:36 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, November 18, 2014 12:11 PM
Points: 116, Visits: 116
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?
Post #682990
Posted Tuesday, March 24, 2009 6:53 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 2:35 PM
Points: 12,962, Visits: 32,498
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

--There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #682993
Posted Friday, March 27, 2009 4:57 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, November 18, 2014 12:11 PM
Points: 116, Visits: 116
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.


Post #685457
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse