Commits

Anonymous committed 4302255

WW-1373 Added RTF support to JasperReportsResult

git-svn-id: http://svn.opensymphony.com/svn/webwork/trunk@2824573baa09-0c28-0410-bef9-dab3c582ae83

Comments (0)

Files changed (2)

src/java/com/opensymphony/webwork/views/jasperreports/JasperReportConstants.java

      * CSV format constant
      */
     public static final String FORMAT_CSV = "CSV";
+
+    /**
+     * RTF format constant
+     */
+    public static final String FORMAT_RTF = "RTF";
 }

src/java/com/opensymphony/webwork/views/jasperreports/JasperReportsResult.java

 import net.sf.jasperreports.engine.export.JRCsvExporterParameter;
 import net.sf.jasperreports.engine.export.JRHtmlExporter;
 import net.sf.jasperreports.engine.export.JRHtmlExporterParameter;
+import net.sf.jasperreports.engine.export.JRRtfExporter;
 import net.sf.jasperreports.engine.export.JRXlsExporter;
 import net.sf.jasperreports.engine.export.JRXmlExporter;
 import net.sf.jasperreports.engine.util.JRLoader;
                     } else if (format.equals(FORMAT_XML)) {
                         response.setContentType("text/xml");
                         exporter = new JRXmlExporter();
+                    } else if (format.equals(FORMAT_RTF)) {
+                        response.setContentType("application/rtf");
+                        exporter = new JRRtfExporter();
                     } else {
                         throw new ServletException("Unknown report format: " + format);
                     }