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:
JasperReportConstants
. If no format is
specified, PDF will be used.Content-disposition = X; filename=X.[format]
).
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>
Modifier and Type | Field and Description |
---|---|
protected String |
connection
Connection which can be passed to the report
instead od dataSource.
|
protected String |
contentDisposition |
protected String |
dataSource |
protected String |
delimiter |
protected String |
documentName |
protected String |
exportParameters
Names an exporter parameters map stack value,
allowing the use of custom export parameters.
|
protected String |
format |
protected String |
imageServletUrl |
protected String |
reportParameters
Names a report parameters map stack value, allowing
additional report parameters from the action.
|
protected String |
timeZone |
protected boolean |
wrapField |
DEFAULT_PARAM, DEFAULT_URL_ENCODING, parseLocation
FORMAT_CSV, FORMAT_HTML, FORMAT_PDF, FORMAT_RTF, FORMAT_XLS, FORMAT_XML
HTTP_REQUEST, HTTP_RESPONSE, PAGE_CONTEXT, SERVLET_CONTEXT, SERVLET_DISPATCHER, STRUTS_ACTION_TAG_INVOCATION, STRUTS_PORTLET_CONTEXT
Constructor and Description |
---|
JasperReportsResult()
Default ctor.
|
JasperReportsResult(String location)
Default ctor with location.
|
Modifier and Type | Method and Description |
---|---|
protected void |
doExecute(String finalLocation,
ActionInvocation invocation) |
String |
getConnection() |
String |
getExportParameters() |
String |
getImageServletUrl() |
String |
getReportParameters() |
void |
setConnection(String connection) |
void |
setContentDisposition(String contentDisposition) |
void |
setDataSource(String dataSource) |
void |
setDelimiter(String delimiter) |
void |
setDocumentName(String documentName) |
void |
setExportParameters(String exportParameters) |
void |
setFormat(String format) |
void |
setImageServletUrl(String imageServletUrl) |
void |
setReportParameters(String reportParameters) |
void |
setTimeZone(String timeZone) |
void |
setWrapField(boolean wrapField) |
conditionalParse, conditionalParseCollection, execute, getLastFinalLocation, getLocation, setEncode, setLocation, setParse
protected String dataSource
protected String format
protected String documentName
protected String contentDisposition
protected String delimiter
protected String imageServletUrl
protected String timeZone
protected boolean wrapField
protected String connection
protected String reportParameters
protected String exportParameters
public JasperReportsResult()
public JasperReportsResult(String location)
location
- Result location.public String getImageServletUrl()
public void setImageServletUrl(String imageServletUrl)
public void setDataSource(String dataSource)
public void setFormat(String format)
public void setDocumentName(String documentName)
public void setContentDisposition(String contentDisposition)
public void setDelimiter(String delimiter)
public void setTimeZone(String timeZone)
timeZone
- set time zone idpublic void setWrapField(boolean wrapField)
public String getReportParameters()
public void setReportParameters(String reportParameters)
public String getExportParameters()
public void setExportParameters(String exportParameters)
public String getConnection()
public void setConnection(String connection)
protected void doExecute(String finalLocation, ActionInvocation invocation) throws Exception
doExecute
in class StrutsResultSupport
Exception
Copyright © 2000–2020 Apache Software Foundation. All rights reserved.