Jump to content
Changes to the Jaspersoft community edition download ×

Isuue with new line in RTF export


arao

Recommended Posts

I'm trying to export a report that contains the following lines:

 

Entire Network: [Filtered]

where:

x=1

y=2

z=3

 

In PDF and HTML formats, the lines appear exactly as shown above. But the RTF export is messed up.

 

RTF Output:

 

Entire Network: [Filtered]:=1=2

=3

How does the RTF interpret a new line? I googled on this and learnt that using 'par' instead of 'n' will work. But, it didn't. Please suggest me a solution for this.

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

I'm using JasperReports 1.2.5

 

Please find the jrxml attached. The 'footer.networkSpan' field in the Group, 'SelectionsGroup' is getting messed up in RTF. The value of this field is one long text, separated by '\n' character.

 

[file name=SimpleConfigSearchReport.jrxml size=16901]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/SimpleConfigSearchReport.jrxml[/file]

Link to comment
Share on other sites

If I hardcode the content for the text field, it will work fine. The value of the text field (footer.networkSpan) comes from a HashMap and it is dynamic. The value is basically one lengthy string, with lot of '\n'. Here's the related java code:

 

public Map getParameterMap() {

Map params = new HashMap();

Map paramsMap = new HashMap();

 

Object value = null;

ReportData reportData = (ReportData)getReportData();

 

value = new Integer(

reportData.getDeviceBeans().size());

paramsMap.put("header.totalItems", value);

 

// Footer params.

StringBuilder span = new StringBuilder();

span.append(reportData.getSpanBean()

.getSpanData(reportData.isFiltered()));

if (reportData.isFiltered()) {

span.append("\n");

span.append("where:");

span.append("\n");

span.append("x=1");

}

paramsMap.put("footer.networkSpan",span.toString());

params.put("paramsMap", paramsMap);

} [file name=SimpleConfigSearchReport-e33e09ac9cfd2686f80dda53c9e2388e.jrxml size=4039]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/SimpleConfigSearchReport-e33e09ac9cfd2686f80dda53c9e2388e.jrxml[/file]

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...