How to achieve multiple pages in Jaspersoft Studio?

0

Hi all,

I have made this report in Jaspersoft Studio which needs to be printed 3 times, but with another title. The other information on the report is the same.

I have no idea how to achieve this, but I came up with an unnested SQL array first:

CASE WHEN a.unnest = '1' THEN 'Title 1' 
 
 
WHEN a.unnest = '2' THEN 'Title 2' 
 
 
WHEN a.unnest = '3' THEN 'Title 3' 
 
 
END AS title_copy
 
 
FROM TABLE_NAME 
 
 
JOIN (SELECT unnest(array['1', '2', '3'])) a ON TRUE 
 
 
WHERE TABLE_NAME.service_id = '123456679' 

Now I need to make something like a while loop based on 'title_copy' but how can this be achieved within Jaspersoft Studio?

If someone have any tips or any other suggestion to achieve 3 (same) pages in Jaspersoft Studio, I would love to hear it.

Thanks in advance!

Jason30's picture
16
Joined: Feb 9 2017 - 4:57am
Last seen: 1 year 11 months ago

1 Answer:

0

Have you considered designing your query as 3 queries combined with a UNION statement and then using PRINT EXPRESSION ? 

   SELECT a,b,c, 'QUERY1' from xtable UNION

   SELECT a,b,c, 'QUERY2' from xtable UNION

   SELECT a,b,c, 'QUERY3' from xtable 

jkeri's picture
142
Joined: Mar 15 2013 - 12:17pm
Last seen: 6 months 7 hours ago
Feedback