com.opensymphony.webwork.views.jasperreports
Class JasperReportsResult
java.lang.Object
com.opensymphony.webwork.dispatcher.WebWorkResultSupport
com.opensymphony.webwork.views.jasperreports.JasperReportsResult
- All Implemented Interfaces:
- JasperReportConstants, com.opensymphony.xwork.Result, Serializable, WebWorkStatics
- public class JasperReportsResult
- extends WebWorkResultSupport
- implements JasperReportConstants
Genreates a JasperReports report using the specified format or PDF if no format is specified.
The following parameters are required:
- location - the location where the compiled jasper report definition is (foo.jasper), relative from current URL
- dataSource - the Ognl expression used to retrieve the datasource from the value stack (usually a List)
Three optional parameter can also be specified:
- format - the format in which the report should be generated. Valid values can be found
in
JasperReportConstants
. If no format is specified, PDF will be used.
- contentDisposition : disposition (defaults to "inline", values are typically filename="document.pdf")
- documentName : name of the document (will generate the http header Content-disposition = X; filename=X.[format])
This result follows the same rules from WebWorkResultSupport
.
Specifically, all three parameters will be parsed if the "parse" parameter is not set to false.
- Author:
- Patrick Lightbody, Rainer Hermanns
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IMAGES_DIR
protected String IMAGES_DIR
JasperReportsResult
public JasperReportsResult()
setDataSource
public void setDataSource(String dataSource)
setFormat
public void setFormat(String format)
setDocumentName
public void setDocumentName(String documentName)
setContentDisposition
public void setContentDisposition(String contentDisposition)
doExecute
protected void doExecute(String finalLocation,
com.opensymphony.xwork.ActionInvocation invocation)
throws Exception
- Description copied from class:
WebWorkResultSupport
- Executes the result given a final location (jsp page, action, etc) and the action invocation
(the state in which the action was executed). Subclasses must implement this class to handle
custom logic for result handling.
- Specified by:
doExecute
in class WebWorkResultSupport
- Parameters:
finalLocation
- the location (jsp page, action, etc) to go to.invocation
- the execution state of the action.
- Throws:
Exception
- if an error occurs while executing the result.