Java Reference
In-Depth Information
<band height="100">
<reportElement x="0" y="0" width="555" height="100"/>
Exporting to plain text makes more sense when the report is completely
(or mostly) text.
Since tables and graphical elements don't translate to plain text
very well.
We created this report template to demonstrate exporting to plain text.
Exciting, isn't it?]]>
The following Java code fragment will export the JasperReports' native report
generated by the above JRXML template into plain text:
package net.ensode.jasperbook;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JRExporterParameter;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.export.JRTextExporter;
import net.sf.jasperreports.engine.export.JRTextExporterParameter;
import net.sf.jasperreports.engine.util.JRLoader;
public class PlainTextExportDemo
public static final String REPORT_DIRECTORY = "reports";
public void plainTextExport(String reportName)
File file = new File(REPORT_DIRECTORY + "/" + reportName +
Search WWH ::

Custom Search