How to break columns into multiple pages in Jasper report

I have one query. Please help me out. kindly refer the below given example.

If I have 20 records with 20 columns, and my page can contain only 10 records with 10 columns at a time. In this case my data is coming like on first page of PDF first 10 records will display with first 10 columns, on second page next 10 records will display with first 10 columns and then remaining columns of first 10 records and so.

But I want my output to be like on first page my first 10 records should come with first 10 columns and then on second page next 10 columns of first 10 records should display instead of next records' first 10 columns.

Kindly suggest me the solution.

Thanks in advance!

krishnarhl's picture
Joined: Jan 27 2015 - 1:31am
Last seen: 5 years 5 months ago

1 Answer:

I actually think JasperReport doesn't support this right now. Have you experimented with Crosstables already?

I can tell you how to hack this specific situation, but that only works if you know how much records will return (which is not the case I guess). 

  • Create tabel, query LIMIT 10 (sort on first 10).
  • Do this again, sort on last 10. 

Now you have 2 tables which act like you want. And if you are very creative maybe you can use this principle to make a subreport that does this for you, so repeats this step 10 times if you have 100 records.


Ps. tagging it with all labels that are not involved (like Google, Hadoop etc.) does not help you. probably sooner the opposit

gert_1's picture
Joined: Aug 7 2014 - 12:25am
Last seen: 7 years 2 weeks ago