How to achieve multiple pages in Jaspersoft Studio?

Jaspersoft Community 'Read-Only' as of July 8, 2022

Transition to New TIBCO Community Just Weeks Away

You can still search, review wiki content, and review discussions in read-only mode. Please email with questions or issues requiring TIBCO review or response.

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
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
Joined: Feb 9 2017 - 4:57am
Last seen: 4 years 10 months ago

1 Answer:

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
Joined: Mar 15 2013 - 12:17pm
Last seen: 3 years 5 months ago