Mat Stephen's SQL Server WebLog

All things SQL Server. Complied by Matthew Stephen - SQL Server Product Specialist, Microsoft UK

Blogs

Reporting Services: How to stop IE striping out leading spaces in report data values

  • Comments 2
  • Likes

Reporting Services: How to stop IE striping out leading spaces in report data values:

My thanks to Russell Christopher and Mike Schetterer who recently discussed the problem that IE will strip out leading spaces from data in a report.  The solution: you have to  replace the spaces with the ASCII code for non-breaking space, not the HTML expression for non-breaking space.  IE wont interpret "&nbsp" as anything other than "&nbsp", this prevents malicious HTML injection.

So the answer is to use the expression : =Replace(Fields!Data.Value, " ", chr(160))

Comments
  • Or, save yourself the trouble of all that and just enclose your report in <pre> tags.

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment