JasperReports underlining all text in HTML reports in Internet Explorer?

Last week I ran into an odd situation with our HTML output from JasperReports in Internet Explorer 7.  All text, link or otherwise,  was being underlined and I’m not really sure of the root cause other than it would appear we ran into a CSS rendering bug.   The same thing does not happen in Firefox 3 (though my research indicated that the same issue occurs in Firefox 2).

In rendering HTML output JasperReports inserts various anchor tags of the form:

<a name="JR_PAGE_ANCHOR_0_1">

It doesn’t use these with href attributes but it does use them for some purpose.

Our global CSS file indicates that anything that is inside an anchor tag should be underlined.  This would make sense assuming that anchors are used for links (a pretty good assumption).    We also use the Dojo JavaScript framework and the Dijit ContentPane widget allows using the ContentPane (normally used with a DIV) to show external content.   That external content can be “scrubbed” to allow it to play in a nicer fashion with the overall site design.  That is where the problem occurs.

The scrubbing of the content coming in to the DIV, to filter out things like styles, TITLEs, and other tags, is where IE seems to have issues.  Those anchor tags mentioned previously, and which look fine in IE when previewing a report inside of the iReport designer, now all have text inside them underlined.   The quick fix, or so I thought, was to remove the A tag from our global CSS file.  That fixes things until someone hovers over any text at which point another CSS rule comes in to play for a:hover and all text is again underlined.    Probably time for another CSS tweak…

2 thoughts on “JasperReports underlining all text in HTML reports in Internet Explorer?

    1. You need to do a CSS fix. Look and see how anchor tags are being styled in your pages.


Comments are closed.

%d bloggers like this: