org.apache.struts2.views.jasperreports
Class JasperReportsResult

java.lang.Object
  extended by org.apache.struts2.dispatcher.StrutsResultSupport
      extended by org.apache.struts2.views.jasperreports.JasperReportsResult
All Implemented Interfaces:
com.opensymphony.xwork2.Result, java.io.Serializable, org.apache.struts2.StrutsStatics, JasperReportConstants

public class JasperReportsResult
extends org.apache.struts2.dispatcher.StrutsResultSupport
implements JasperReportConstants

Generates a JasperReports report using the specified format or PDF if no format is specified.

This result type takes the following parameters:

This result follows the same rules from StrutsResultSupport. Specifically, all parameters will be parsed if the "parse" parameter is not set to false.

Example:

 <result name="success" type="jasper">
   <param name="location">foo.jasper</param>
   <param name="dataSource">mySource</param>
   <param name="format">CSV</param>
 </result>
 
or for pdf

 <result name="success" type="jasper">
   <param name="location">foo.jasper</param>
   <param name="dataSource">mySource</param>
 </result>
 

See Also:
Serialized Form

Field Summary
protected  java.lang.String contentDisposition
           
protected  java.lang.String dataSource
           
protected  java.lang.String delimiter
           
protected  java.lang.String documentName
           
protected  java.lang.String format
           
protected  java.lang.String imageServletUrl
           
 
Fields inherited from class org.apache.struts2.dispatcher.StrutsResultSupport
DEFAULT_PARAM
 
Fields inherited from interface org.apache.struts2.views.jasperreports.JasperReportConstants
FORMAT_CSV, FORMAT_HTML, FORMAT_PDF, FORMAT_RTF, FORMAT_XLS, FORMAT_XML
 
Fields inherited from interface org.apache.struts2.StrutsStatics
HTTP_REQUEST, HTTP_RESPONSE, PAGE_CONTEXT, SERVLET_CONTEXT, SERVLET_DISPATCHER, STRUTS_PORTLET_CONTEXT
 
Constructor Summary
JasperReportsResult()
           
JasperReportsResult(java.lang.String location)
           
 
Method Summary
protected  void doExecute(java.lang.String finalLocation, com.opensymphony.xwork2.ActionInvocation invocation)
           
 java.lang.String getImageServletUrl()
           
 JasperReportsResult setContentDisposition(java.lang.String contentDisposition)
           
 JasperReportsResult setDataSource(java.lang.String dataSource)
           
 JasperReportsResult setDelimiter(java.lang.String delimiter)
           
 JasperReportsResult setDocumentName(java.lang.String documentName)
           
 JasperReportsResult setFormat(java.lang.String format)
           
 JasperReportsResult setImageServletUrl(java.lang.String imageServletUrl)
           
 
Methods inherited from class org.apache.struts2.dispatcher.StrutsResultSupport
conditionalParse, execute, getLastFinalLocation, setEncode, setLocation, setParse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dataSource

protected java.lang.String dataSource

format

protected java.lang.String format

documentName

protected java.lang.String documentName

contentDisposition

protected java.lang.String contentDisposition

delimiter

protected java.lang.String delimiter

imageServletUrl

protected java.lang.String imageServletUrl
Constructor Detail

JasperReportsResult

public JasperReportsResult()

JasperReportsResult

public JasperReportsResult(java.lang.String location)
Method Detail

getImageServletUrl

public java.lang.String getImageServletUrl()

setImageServletUrl

public JasperReportsResult setImageServletUrl(java.lang.String imageServletUrl)

setDataSource

public JasperReportsResult setDataSource(java.lang.String dataSource)

setFormat

public JasperReportsResult setFormat(java.lang.String format)

setDocumentName

public JasperReportsResult setDocumentName(java.lang.String documentName)

setContentDisposition

public JasperReportsResult setContentDisposition(java.lang.String contentDisposition)

setDelimiter

public JasperReportsResult setDelimiter(java.lang.String delimiter)

doExecute

protected void doExecute(java.lang.String finalLocation,
                         com.opensymphony.xwork2.ActionInvocation invocation)
                  throws java.lang.Exception
Specified by:
doExecute in class org.apache.struts2.dispatcher.StrutsResultSupport
Throws:
java.lang.Exception


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.