flamant Posted June 29, 2012 Share Posted June 29, 2012 Hi,I have a report with special caracterswhen I generate the jrxml String it includes special characters and I get an error at line 2 (see the following)(in jrxml, I have for example a static Text "<text><![CDATA[" + field.getFldText() + "]]></text>" with special characters in field.getFldText())line 1 - InputStream jrxmlInputStream = new ByteArrayInputStream(jrxml.toString().getBytes());line 2 - JasperDesign jasperDesign = JRXmlLoader.load(jrxmlInputStream); So, I try to escape special characters (xml escaping) the raw data ( field.getFldText() ) and to use an imported class in jrxml to unescape back ( xml unescaping ) the data<import value=\"org.apache.commons.lang.StringEscapeUtils\" /> under jasperReport tagAnd for the static Text<text><![CDATA[stringEscapeUtils.unescapeXml(").append(StringEscapeUtils.escapeXml(field.getFldText())).append(")]]></text> But it seems that org.apache.commons.lang.StringEscapeUtils.unescapeXml() is not used as a java class but as a raw String (in jrxml, I can see the following: <text><![CDATA[stringEscapeUtils.unescapeXml(Do NOT use the following symbols: \ (backward slash), é, Ä, ß, µ (non-English language symbols), °C (superscripts), ¾ (fractions), symbols < and > and quotation marks)]]></text> I conclude that I don't use the right way to use imported java class. Do you have an idea ? Thank you in advance for your answers 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