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:
Result, java.io.Serializable, StrutsStatics, JasperReportConstants

public class JasperReportsResult
extends 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 connection
          Connection which can be passed to the report instead od dataSource.
protected  java.lang.String contentDisposition
           
protected  java.lang.String dataSource
           
protected  java.lang.String delimiter
           
protected  java.lang.String documentName
           
protected  java.lang.String exportParameters
          Names an exporter parameters map stack value, allowing the use of custom export parameters.
protected  java.lang.String format
           
protected  java.lang.String imageServletUrl
           
protected  java.lang.String reportParameters
          Names a report parameters map stack value, allowing additional report parameters from the action.
protected  java.lang.String timeZone
           
 
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_ACTION_TAG_INVOCATION, STRUTS_PORTLET_CONTEXT
 
Constructor Summary
JasperReportsResult()
          Default ctor.
JasperReportsResult(java.lang.String location)
          Default ctor with location.
 
Method Summary
protected  void doExecute(java.lang.String finalLocation, ActionInvocation invocation)
           
 java.lang.String getConnection()
           
 java.lang.String getExportParameters()
           
 java.lang.String getImageServletUrl()
           
 java.lang.String getReportParameters()
           
 void setConnection(java.lang.String connection)
           
 void setContentDisposition(java.lang.String contentDisposition)
           
 void setDataSource(java.lang.String dataSource)
           
 void setDelimiter(java.lang.String delimiter)
           
 void setDocumentName(java.lang.String documentName)
           
 void setExportParameters(java.lang.String exportParameters)
           
 void setFormat(java.lang.String format)
           
 void setImageServletUrl(java.lang.String imageServletUrl)
           
 void setReportParameters(java.lang.String reportParameters)
           
 void setTimeZone(java.lang.String timeZone)
          set time zone id
 
Methods inherited from class org.apache.struts2.dispatcher.StrutsResultSupport
conditionalParse, execute, getLastFinalLocation, getLocation, 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

timeZone

protected java.lang.String timeZone

connection

protected java.lang.String connection
Connection which can be passed to the report instead od dataSource.


reportParameters

protected java.lang.String reportParameters
Names a report parameters map stack value, allowing additional report parameters from the action.


exportParameters

protected java.lang.String exportParameters
Names an exporter parameters map stack value, allowing the use of custom export parameters.

Constructor Detail

JasperReportsResult

public JasperReportsResult()
Default ctor.


JasperReportsResult

public JasperReportsResult(java.lang.String location)
Default ctor with location.

Parameters:
location - Result location.
Method Detail

getImageServletUrl

public java.lang.String getImageServletUrl()

setImageServletUrl

public void setImageServletUrl(java.lang.String imageServletUrl)

setDataSource

public void setDataSource(java.lang.String dataSource)

setFormat

public void setFormat(java.lang.String format)

setDocumentName

public void setDocumentName(java.lang.String documentName)

setContentDisposition

public void setContentDisposition(java.lang.String contentDisposition)

setDelimiter

public void setDelimiter(java.lang.String delimiter)

setTimeZone

public void setTimeZone(java.lang.String timeZone)
set time zone id

Parameters:
timeZone -

getReportParameters

public java.lang.String getReportParameters()

setReportParameters

public void setReportParameters(java.lang.String reportParameters)

getExportParameters

public java.lang.String getExportParameters()

setExportParameters

public void setExportParameters(java.lang.String exportParameters)

getConnection

public java.lang.String getConnection()

setConnection

public void setConnection(java.lang.String connection)

doExecute

protected void doExecute(java.lang.String finalLocation,
                         ActionInvocation invocation)
                  throws java.lang.Exception
Specified by:
doExecute in class StrutsResultSupport
Throws:
java.lang.Exception


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