struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tschnei...@apache.org
Subject svn commit: r508875 - in /struts/struts2/branches/STRUTS_2_0_X/plugins/jasperreports/src/main/java/org/apache/struts2/views/jasperreports: JasperReportConstants.java JasperReportsResult.java
Date Sun, 18 Feb 2007 06:02:23 GMT
Author: tschneider
Date: Sat Feb 17 22:02:23 2007
New Revision: 508875

URL: http://svn.apache.org/viewvc?view=rev&rev=508875
Log:
WW-1632 - added rtf support for jasper report result

Modified:
    struts/struts2/branches/STRUTS_2_0_X/plugins/jasperreports/src/main/java/org/apache/struts2/views/jasperreports/JasperReportConstants.java
    struts/struts2/branches/STRUTS_2_0_X/plugins/jasperreports/src/main/java/org/apache/struts2/views/jasperreports/JasperReportsResult.java

Modified: struts/struts2/branches/STRUTS_2_0_X/plugins/jasperreports/src/main/java/org/apache/struts2/views/jasperreports/JasperReportConstants.java
URL: http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/plugins/jasperreports/src/main/java/org/apache/struts2/views/jasperreports/JasperReportConstants.java?view=diff&rev=508875&r1=508874&r2=508875
==============================================================================
--- struts/struts2/branches/STRUTS_2_0_X/plugins/jasperreports/src/main/java/org/apache/struts2/views/jasperreports/JasperReportConstants.java
(original)
+++ struts/struts2/branches/STRUTS_2_0_X/plugins/jasperreports/src/main/java/org/apache/struts2/views/jasperreports/JasperReportConstants.java
Sat Feb 17 22:02:23 2007
@@ -51,4 +51,9 @@
      * CSV format constant
      */
     public static final String FORMAT_CSV = "CSV";
+    
+    /**
+     * RTF format constant
+     */
+    public static final String FORMAT_RTF = "RTF";
 }

Modified: struts/struts2/branches/STRUTS_2_0_X/plugins/jasperreports/src/main/java/org/apache/struts2/views/jasperreports/JasperReportsResult.java
URL: http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/plugins/jasperreports/src/main/java/org/apache/struts2/views/jasperreports/JasperReportsResult.java?view=diff&rev=508875&r1=508874&r2=508875
==============================================================================
--- struts/struts2/branches/STRUTS_2_0_X/plugins/jasperreports/src/main/java/org/apache/struts2/views/jasperreports/JasperReportsResult.java
(original)
+++ struts/struts2/branches/STRUTS_2_0_X/plugins/jasperreports/src/main/java/org/apache/struts2/views/jasperreports/JasperReportsResult.java
Sat Feb 17 22:02:23 2007
@@ -32,22 +32,30 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import net.sf.jasperreports.engine.*;
+import net.sf.jasperreports.engine.JRException;
+import net.sf.jasperreports.engine.JRExporter;
+import net.sf.jasperreports.engine.JRExporterParameter;
+import net.sf.jasperreports.engine.JRParameter;
+import net.sf.jasperreports.engine.JasperExportManager;
+import net.sf.jasperreports.engine.JasperFillManager;
+import net.sf.jasperreports.engine.JasperPrint;
+import net.sf.jasperreports.engine.JasperReport;
 import net.sf.jasperreports.engine.export.JRCsvExporter;
 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;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-
-import com.opensymphony.xwork2.util.TextUtils;
 import org.apache.struts2.ServletActionContext;
 import org.apache.struts2.dispatcher.StrutsResultSupport;
+
 import com.opensymphony.xwork2.ActionInvocation;
+import com.opensymphony.xwork2.util.TextUtils;
 import com.opensymphony.xwork2.util.ValueStack;
 
 /**
@@ -286,6 +294,9 @@
                     } 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);
                     }



Mime
View raw message