Jump to content
We've recently updated our Privacy Statement, available here ×

Large detail bands


soubierj
Go to solution Solved by elizam,

Recommended Posts

I have searched everywhere and believe this is not possible, but I wanted to verify.

I am using JasperReports library 6.2.0.  I have around 350 text fields per database record that I need to display vertically.  Each text field may or may not display, depending on whether it is blank or not.  Each text field has a Position Type of Float, Remove Line When Blank set to true, and a Print When Expression that evaluates to false if it should not be displayed.

If I put them all into a single large detail band, I need to make my page size around 10,500 pixels, which makes the PDF export unusable.

I then tried breaking the report into several subreports, both in their own detail band and in a single detail band.  I gave each subreport and detail band on the main report a height of 0.  Now the problem is large amounts of blank space at the bottom of some pages in the PDF export.  For example, if all the fields on subreport 3 are blank except 1, it may print on the next page even though there is clearly enough room on the previous page.  From my research, I'm guessing this is because the design-time height of the subreport is used for page break calculations.

Is there any way around this?  At the moment I have been forced to create 58 subreports each no more then 2.5 inches tall to make sure I don't wind up with more than 2.5 inches of blank space.

 

Thanks in advance!

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Solution

If you are using 6.3, you might try frames.  As of 6.3 (or maybe 6.2) you can size a frame smaller than its contents and it then expands as necessary:

Finally, the frame automatically stretches according to its content, and the element position type property of its elements refer to the frame itself, not to the band, making the design a bit easier to manage."

http://community.jaspersoft.com/documentation/tibco-jaspersoft-studio-user-guide/v630/using-frames

Link to comment
Share on other sites

  • 2 weeks later...

Thanks - that is an improvement, in that I can now use a single report file.  I am still getting unexpected page breaks in the PDF, though.  There appears to be a problem in the removeBlankElements function in JRFillElementContainer, where it believes there is no space left too early.  Any one have any thoughts on this?

Thanks

EDIT: Never mind - I realized last night I can put each row of fields in a frame of 0 height.  Once I did that, page breaks were correct.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...