jasperreport: how to export into rtf file?
HI!
I am referring to the code suggested in:
http://developers.sun.com/prodtech/javatools/jsenterprise/reference/techart/jse8/jasper_reports.html#2
This is the code:
String reportSource = "./report/templates/HelloReportWorld.jrxml";
String reportDest = "./report/results/HelloReportWorld.html";
Map<String, Object> params = new HashMap<String, Object>();
try
{
JasperReport jasperReport =
JasperCompileManager.compileReport(reportSource);
JasperPrint jasperPrint =
JasperFillManager.fillReport(
jasperReport, params, new JREmptyDataSource());
JasperExportManager.exportReportToHtmlFile(
jasperPrint, reportDest);
JasperViewer.viewReport(jasperPrint);
}
catch (JRException ex)
{
ex.printStackTrace();
}
It work well and I have easily changed it exporting in a PDF file only
substituting "exportReportToHtmlFile" with "exportReportToPdfFile";
unfortunately the JasperExportManager do not have a
"exportReportToRtfFile" and I think that in that case it's necessary
to use in such a way JRRtfExporter and I am unable tu do that.
So, can anyone write me a snipped of code to export instead in a RTF
file?
Thank you in advance,. Franco from Italy