The entity name must immediately follow the '&' in the entity reference error in jasper reports
Asked Answered
A

3

7

I have a Master report that has 4 subreports. The report gets generated successfully when I generate the report in iReport(version 4.1.3). However when the report gets deployed in JBoss server it gives the following error

Error Parsing Styled Text
"org.xml.sax.SAXParseException: The entity name must immediately follow the '&' in the entity reference jasper reports".

Its corresponding blank report that does not have any mapping with the datsource is getting generated successfully. However the one which fetches the values from the data source is throwing this error.

Could you please tell me what could be the issue.

iReport version: 4.1.3

Datasource: XML datasource

Please let me know if you need more information.

Ambivalence answered 21/6, 2012 at 12:2 Comment(0)
J
20

My guess is that your XML datasource contains '&' character in some data.

If so replace '&' with & and try, it should work properly.

PS: You should accept answers if they help you.!!

EDIT : Check out this discussion at JasperForge Forum. Says the same

Josuejosy answered 21/6, 2012 at 14:18 Comment(2)
I had the same issue. This answer helped me also.Heins
Glad to know that it helped Paul.! :)Josuejosy
O
10

Common in xml how to escape the errors:

  1. ampersand (&) is escaped to &
  2. double quotes (") are escaped to "
  3. single quotes (') are escaped to '
  4. less than (<) is escaped to . &lt;
  5. greater than (>) is escaped to . &gt;
Obelia answered 29/7, 2013 at 6:39 Comment(0)
B
0

You should escape the special character. You could look into StringEscapeUtils from the Apache Commons Lang library.

Bertold answered 25/4, 2013 at 6:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.