Jump to content
JasperReports Library 7.0 is now available ×

Justify problem


agiupponi

Recommended Posts

I've a big problem with justified text field. With the same template, the report appeared correctly justified in pdf rendering, but in rtf the entire paragraph, including the last line, was justified. This is not correct, because the last line, ending with nr, must be left align....

 

Are there a solution or is a bug?

 

Thanks in advance,

Alessandro

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

  • 6 years later...

4.5.1

 

Problem is in

net.sf.jasperreports.engine.export.JRRtfExporter

 

fix: \line to \par => Shift+Enter to Enter

 

private String handleUnicodeText(String sourceText) {

StringBuffer unicodeText = new StringBuffer();

for (int i = 0; i < sourceText.length(); i++) {

long ch = sourceText.charAt(i);

if (ch > 127) {

unicodeText.append("\u" + ch + '?');

} else if (ch == 'n') {

// fix: \line to \par

unicodeText.append("\par ");

} else if ((ch == '\') || (ch == '{') || (ch == '}')) {

unicodeText.append('\').append((char) ch);

} else {

unicodeText.append((char) ch);

}

}

return unicodeText.toString();

}

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...