Home > .net 2.0, .net 3.0, .net 3.5, c#, Visual Studio 2005, Visual Studio 2008 > HTML Formatting and Spacing in ActiveReports

HTML Formatting and Spacing in ActiveReports

March 6, 2009

ActiveReport’s RichTextBox is great for presenting HTML-styled content on PDF reports; however, there seems to be a snag with a few of the HTML tags and how the RichTextBox translates the commands to HTML.

To print out a bit of HTML (from a field), I have the following StringBuilder my details_Format:

builder

       .AppendFormat(

       @”{0}On {1}, <strong>{2}</strong> wrote: <br/>{3}<br/><br/>{4}”,

       […]);

However, the <strong> tags are not properly rendering spaces between them:

Issues with Spacing

There seems to be an existing notice on the DataDynamics forums (here) regarding the spacing, but it’s from 2007–-I’d assume it’s been fixed by now; however, I can’t find it in any of the AR3.0 release notes.

So what’s the fix?

Force the spaces in with non-breaking space commands.

       @”{0}On {1},&nbsp;<strong>{2}</strong>&nbsp;wrote: <br/>{3}<br/><br/>{4}”,

Bingo!

Fix With Spacing

  1. March 11, 2009 at 11:01 am

    I would like to inform you that we are aware of this issue and it will be addressed in one of our maintenance releases in the near future. The workaround you have provided on your blog post is a good solution for the short term, but you will need to consider that once this issue is addressed you may have an extra space on each side of the strong tag.

    -Jon

    GrapeCity-Data Dynamics

  1. No trackbacks yet.
Comments are closed.
%d bloggers like this: