Jump to content
Changes to the Jaspersoft community edition download ×

passing params in query and subreports

Recommended Posts

By: Patria - phlukman

passing params in query and subreports

2003-04-15 07:48

I am building a report ( MasterReport.xml) with a subreport ( ChildReport.xml).


MasterReport.xml is as follows:


<parameter name="SistemaCodigo" class="java.lang.String"/>

<parameter name="Alias" class="java.lang.String"/>


<queryString><![CDATA[sELECT sist_cod,SUBSTR(tage_nom,1,40) as tage_nom, SUBSTR(tage_alias,1,10) AS tage_alias,SUBSTR(tage_campo1,1,20) as tage_campo1,SUBSTR(tage_campo2,1,20) as tage_campo2, SUBSTR(tage_campo3,1,20) as tage_campo3 FROM tage

WHERE sist_cod LIKE $P!{SistemaCodigo} AND tage_alias LIKE $P!{Alias} ORDER BY sist_cod,tage_nom ]]></queryString>


<field name="tage_alias" class="java.lang.String"/>


<subreport isUsingCache="true">




<subreportParameter name="Alias">








<subreportExpression class="dori.jasper.engine.JasperReport"><![CDATA[







ChildReport.xml is as follows:


<parameter name="Alias" isForPrompting="true" class="java.lang.String"/>


SELECT tage_alias, vatg_cod,SUBSTR(vatg_des,1,40) as vatg_des,vatg_nom_variable,SUBSTR(vatg_valor1,1,20) as vatg_valor1, SUBSTR(vatg_valor2,1,20) as vatg_valor2,SUBSTR(vatg_valor3,1,20) as vatg_valor3,

vatg_param,vatg_des_larga FROM vatg where tage_alias=$P{Alias} ORDER BY vatg_cod


<field name="tage_alias


In the calling program:





and I follow the proces of compilation and filling which works fine. The resulting .jasper file for this query is 1 MB aprox.

When I am exporting the .jasper file to pdf format via JasperExportManager.exportReportToPdfFile(fileName);

it seems it gets stuck, but it does not show any error.

However, when I hardcode the values of SistemaCodigo and Alias as 'AFI' and '%' respectively within the MasterReport.xml the whole process works.....

any hint? I would really appreciate it.




Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...