[#4902] - XML escape data for use in styled textfields

Category:
Bug report
Priority:
High
Status:
New
Project: Severity:
Major
Resolution:
Open
Component: Reproducibility:
Always
Assigned to:
0

When a report contains textfields that use styled markup (markup="styled") and the data that is used to fill these textfields contains unescaped XML characters - like an ampersand - the following exception occurs:

2010-09-16 13:52:06,638 FATAL [net.sf.jasperreports.engine.util.JRStyledTextParser] Error parsing styled text.
org.xml.sax.SAXParseException: The entity name must immediately follow the '&' in the entity reference.

I think it's up to JasperReports to properly escape these characters (you can't possible expect a report designer to add escaping in every single textfield). See the attached patch for a fix.

AttachmentSize
File JRStyledTextParser-trunk.patch596 bytes
rkettelerij's picture
Joined: Jan 11 2010 - 8:38am
Last seen: 12 years 2 weeks ago

2 Comments:

#1

Dear teodord,

Please let us know when this fix will be available for GeneralUse.

regards,
Prasanna

#2

I implemented the patch. - It did not help! (iReport Designer 4.0.1)

Feedback