You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Tom Schneider (JIRA)" <ji...@apache.org> on 2007/11/05 01:16:34 UTC

[jira] Closed: (WW-1946) JasperReports-Plugin custom parameteres

     [ https://issues.apache.org/struts/browse/WW-1946?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tom Schneider closed WW-1946.
-----------------------------

    Resolution: Won't Fix
      Assignee: Tom Schneider

Poking around in the documentation, I found that this was already documented here: http://struts.apache.org/2.x/docs/jasperreports-tutorial.html  So I'm resolving this as won't fix because needed functionality is already available.

> JasperReports-Plugin custom parameteres
> ---------------------------------------
>
>                 Key: WW-1946
>                 URL: https://issues.apache.org/struts/browse/WW-1946
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Plugin - JasperReports
>    Affects Versions: 2.0.6
>            Reporter: Carlos Cristales
>            Assignee: Tom Schneider
>             Fix For: 2.1.1
>
>
> I need to pass custom params to the JasperReport-Plugin, to customize the title report by example,
> and I solve my need by this way
> * add a property customParameters to JasperReportsResult with the respective seter:
>     public void setCustomParameters(String customParameters) {
>         this.customParameters = customParameters;
>     }
> * load the customParameters before to generate the report, just after to initialize the
>    parameters property by the plugin:
>                 //getting the map of parameters
>                 Map mapParameters = (Map) stack.findValue(customParameters);
>                 if (mapParameters != null) {
>                         parameters.putAll(mapParameters);
>                 }
> * in the struts2 action, I add a Map property and setting values to customize the report title
>     jasperParams = new HashMap();
>     jasperParams.put("titulo02", "Listado General de Usuarios");
>     jasperParams.put("titulo03", "Filtrados por Departamento y Role");
> * mapping the action in the struts.xml
>                 <action name="usuariosJasper" class="usuarioAction" method="print">
>                         <result name="success" type="jasper">
>                                 <param name="location">/reportes/usuarios.jasper</param>
>                                 <param name="dataSource">usuarios</param>
> 		         	  <param name="customParameters">jasperParams</param>
> 	         		  <param name="format">PDF</param>
>                         </result>
>                 </action> 
> P.D
> I'am very newbie in this, and I'am not sure if this the correct way to report this,
> in adition my englhis is very bad, bot I hope this post may to help to someone.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.