Skip to main content
Announcements
A fresh, new look for the Data Integration & Quality forums and navigation! Read more about what's changed.
cancel
Showing results for 
Search instead for 
Did you mean: 
pawe84
Creator

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.

Labels (1)
  • v8.x

1 Solution

Accepted Solutions
pawe84
Creator
Author

I solved this issue. You have to create parameters in your report designer.

View solution in original post

2 Replies
pawe84
Creator
Author

I solved this issue. You have to create parameters in your report designer.

jlolling
Creator III

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.