moromete1977 Posted March 4, 2011 Share Posted March 4, 2011 Hi,This is a sample textfield in one of my reports.<textField isStretchWithOverflow="true"> <reportElement key="textHeaderColumn" style="Crosstab Data Text" x="0" y="0" width="96" height="30" forecolor="#FFFFFF"/> <box leftPadding="0" rightPadding="0"/> <textElement textAlignment="Left" verticalAlignment="Middle"> <font fontName="Arial" size="11"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$V{name}]]></textFieldExpression> </textField>If the $V{name} contains an ampersand, the following will be added in logs (report is rendered correctly, though). FATAL JRStyledTextParser:1035 - Error parsing styled text.org.xml.sax.SAXParseException: The entity name must immediately follow the '&' in the entity reference. Any solution to not have this in logs? Thanks. Link to comment Share on other sites More sharing options...
szaharia Posted March 7, 2011 Share Posted March 7, 2011 Hi,If your "Crosstab Data Text" style contains either "isStyledText" or "markup" attribute, then the '&' char should be escaped. Try with & instead of &.Hope this helps,sanda Link to comment Share on other sites More sharing options...
Solution szaharia Posted March 8, 2011 Solution Share Posted March 8, 2011 To be more precise, use $V{name}.replaceAll("&","&")Hope this helps,sanda Link to comment Share on other sites More sharing options...
moromete1977 Posted March 8, 2011 Author Share Posted March 8, 2011 Thank you, this solved the problem. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now