Adjust detail bands dynamically to not leave empty spaces when elements stretch
Posted on March 16, 2017 at 2:43pm
I am trying to create a pdf report and show the database record in this pdf report.Our business requires that this pdf has certain template style. So i created the template using jasper studio, summary of what i did:
Created A4 size jasper report.
created 4 detail bands, 3 to its maximum allowed(802 px) and last one to 500 px.
created elements in first detail band to fit into 802 px.
It works fine if the data to be presented fits exactly the given dimensions. I have set StretchWithOverFlow to true for all the dynamic text fields, in case if some fields need to stretch. I see problem when some fields might have to stretch, When the fields stretch some of the content in band one is put into page 2 , the rest of page 2 is left blank and detail band 2 starts from page 3. I need to make detail band 2 to start from where detail band 1 ended.