Struts 2 > Home > Guides > Core Developers Guide > Result Types > JasperReports Result |

Struts 2
JasperReports Result
Edit Page Browse Space Add Page Add News
Added by casey, last edited by Ted Husted on Sep 10, 2006 (view change)

Content pulled from external source. Click here to refresh.
Generates a JasperReports report using the specified format or PDF if no format is specified.

## Parameters

Content pulled from external source. Click here to refresh.
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 StrutsResultSupport. Specifically, all parameters will be parsed if the "parse" parameter is not set to false.

## Examples

Content pulled from external source. Click here to refresh.
    <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:

Content pulled from external source. Click here to refresh.
    <result name="success" type="jasper">
      <param name="location">foo.jasper</param>
      <param name="dataSource">mySource</param>
    </result>