com.opensymphony.webwork.views.jasperreports
Class JasperReportsResult
java.lang.Object
com.opensymphony.webwork.dispatcher.WebWorkResultSupport
com.opensymphony.webwork.views.AbstractHttpHeaderPopulatingResult
com.opensymphony.webwork.views.jasperreports.JasperReportsResult
- All Implemented Interfaces:
- JasperReportConstants, WebWorkStatics, Result, Serializable
public class JasperReportsResult
- extends AbstractHttpHeaderPopulatingResult
- implements JasperReportConstants
Generates a JasperReports report using the specified format or PDF if no
format is specified.
This result type takes the following parameters:
- location (default) - the location where the compiled jasper report
definition is (foo.jasper), relative from current URL.
- dataSource (required) - the Ognl expression used to retrieve the
datasource from the value stack (usually a List).
- parse - true by default. If set to false, the location param will
not be parsed for Ognl expressions.
- 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]
).
- delimiter - the delimiter used when generating CSV reports. By
default, the character used is ",".
- imageServletUrl - name of the url that, when prefixed with the
context page, can return report images.
This result follows the same rules from WebWorkResultSupport
.
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>
- Version:
- $Date: 2007-11-30 18:45:26 +0800 (Fri, 30 Nov 2007) $ $Id: JasperReportsResult.java 2977 2007-11-30 10:45:26Z tm_jee $
- Author:
- Patrick Lightbody, Rainer Hermanns, tmjee
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
dataSource
protected String dataSource
format
protected String format
documentName
protected String documentName
contentDisposition
protected String contentDisposition
delimiter
protected String delimiter
imageServletUrl
protected String imageServletUrl
JasperReportsResult
public JasperReportsResult()
getImageServletUrl
public String getImageServletUrl()
setImageServletUrl
public void setImageServletUrl(String imageServletUrl)
setDataSource
public void setDataSource(String dataSource)
setFormat
public void setFormat(String format)
setDocumentName
public void setDocumentName(String documentName)
setContentDisposition
public void setContentDisposition(String contentDisposition)
setDelimiter
public void setDelimiter(String delimiter)
afterHttpHeadersPopulatedExecute
protected void afterHttpHeadersPopulatedExecute(String finalLocation,
ActionInvocation invocation)
throws Exception
- Description copied from class:
AbstractHttpHeaderPopulatingResult
- This method is meant for subclass to override, it is called after the http headers
have been set into the current http response.
- Specified by:
afterHttpHeadersPopulatedExecute
in class AbstractHttpHeaderPopulatingResult
- Throws:
Exception