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

扶醉桌前 提交于 2019-12-01 05:18:48

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

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;

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!