
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Create for each iteration report file with tJasperReportExec,
Hi everyone,
I have a sql query which will give invoice numbers as result.
How I can use iterate with tJasperReportExec so that I'll get for each invoice number a new pdf file?
I am using the jrxml file which I created in Jasper Studio.
At this file is another sql query stored.
Do I have to edit the jrxml file and have to put my Talend context variable inside so that tJasperReportExec can iterate it?
Example modification to jrxml, sql query part
<queryString language="SQL">
<![CDATA[
select
a.invoice_no,
a.customer,
b.product,
b.amount
from sales_header a
inner join sales_line b on a.invoice_no = b.fk_invoice_no
where a.Status = 1
and a.No_='"context.talend_inv_no"']]>
</queryString>
This would be my talend job setup (see attched screenshot).
Thanks in advance for any hints.
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I solved this issue. You have to create parameters in your report designer.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I solved this issue. You have to create parameters in your report designer.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
jrxml query also allows not only one value as parameter, you can also handover a list as value for a parameter which will converted into a "my_field in (....)" expression.
Example for an sql expression in jasper reports:
select * from my_table where $X{IN, colname, parameter_name}
This works also if your list is empty and will not disrupts your query.
