Hi All,
I am using crosstab and in one of the text fields I set the markup="html".
The data passed to the text field is something like : <a href=" http://www.google.com/"/>, and it is coverted in my report to <a href=" http://www.google.com/"/> and causes the following exception:
018-03-30 01:14:43,930 ERROR n.s.j.e.util.JRStyledTextParser - Error parsing styled text.
org.xml.sax.SAXParseException: The entity "nbsp" was referenced, but not declared.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
at org.apache.xerces.impl.XMLScanner.scanAttributeValue(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanAttribute(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at net.sf.jasperreports.engine.util.JRStyledTextParser.parse(JRStyledTextParser.java:235)
at net.sf.jasperreports.engine.util.JRStyledTextParser.getStyledText(JRStyledTextParser.java:268)
at net.sf.jasperreports.engine.fill.JRFillTextElement.getStyledText(JRFillTextElement.java:608)
at net.sf.jasperreports.engine.fill.JRFillTextElement.getText(JRFillTextElement.java:640)
Does anyone have any idea how to fix this?
Thanks in advance
4 Answers:
Have you tried deleting the space in front of "http:"?
There is a space in front of "http:".
<a href=" http://www.google.com/"/>,
Delete this space so it will be like below.
<a href="http://www.google.com/"/>,