[#5709] - Detail page splitting wrong when remove line when blank is used

Category:
Bug report
Priority:
Urgent
Status:
Resolved
Project: Severity:
Feature
Resolution:
Fixed
Component: Reproducibility:
N/A
Assigned to:
0

I ran on a similar issue that was discussed in this forum thread
http://jasperforge.org/plugins/espforum/view.php?group_id=102&forumid=10...
but no good solution was provided there.

The issue is that if you have two text fields in a detail band one below another, both with
"stretch with overflow" = true
"position type" = float
"remove line when blank" = true
"blank when null" = true

then there's a pagination problem (page break is inserted too early) if the first field is empty for any reason (e.g. the field value is null or printwhen is set to false).

If remove line when blank is set to false, then there is an empty space instead of the first text field, but the page break is inserted correctly.

Please find attached jrxml and screenshots demonstrating the issue.

My test case is very simple and trivialized (normally you don't setup text fields of such a height) but it happens in real life when you have lot of normal sized fields printed optionally. It happens also when using subreports instead of text fields.

AttachmentSize
Binary Data -----report1.jrxml2.45 KB
File test-ireport.xml828 bytes
Image icon design.png14.2 KB
Image icon correct-case.png18.2 KB
Image icon incorrect-case.png16.32 KB
mkostrze's picture
Joined: Oct 9 2006 - 11:52pm
Last seen: 4 years 1 month ago

5 Comments:

#1

Note about attachments:

report1.jrxml - the design demonstrating the problem
test-ireport.xml - test XML file, the select expression should be /root
correct-case.png - preview screenshot done when "remove line when blank" = false
incorrect-case.png - preview screenshot done when "remove line when blank" = true. This screenshot demonstrates the problem.

#2
  • Resolution:Open» Works as Designed
  • Status:New» Resolved

Hi,

This works as designed.

The collapse of empty space resulting from elements not rendering is the last operation that occurs when laying out content.

By the time the white space is removed for the large text element appearing at the top, all space allocation for the other elements in the same container (band) has been done.

The solution to avoid such problems is to separate the elements into different containers.
In your example, you can use two detail bands, as the detail section of a report template is multiband.
This way, the collapse of the missing first text field would occur before the second band is given the chance to occupy remaining space.

By the way you arrange content into bands you control the way white space collapses and optimize layout.

I hope this helps.
Teodor

#3
  • Priority:Normal» Urgent
  • Severity:Minor» Feature
  • Reproducibility:Always» N/A
  • Resolution:Works as Designed» Reopened
  • Status:Resolved» Feedback Requested

Hi,

I am having the same problem. But splitting the container (band), in my case a group footer, into multiple containers just causes more problems.

I need the contents of the group footer to be printed on the same page, but when splitting the contents into multiple containers i am not able to ensure that the second container is not able to break to the next page if the first container did not not have to.

Are there any suggestions regarding this problem?

#4

Hi,

Starting with version 6.1.1, we introduced the possibility that frame elements could be made smaller than their content.
In your case, you could try take the whole content of your large band and isolate it into a frame, for which you can then set a smaller height, provided that the frame will grow at runtime to accommodate all its rendering content.
This way the band will grow as necessary instead of shrinking due to internal content collapsing.

I hope this helps.
Teodor

#5
  • Resolution:Reopened» Fixed
  • Status:Feedback Requested» Resolved

Hi,

Feel free to reopen in case you still have this problem with the latest version and the provided solution.

Thanks,
Teodor

Feedback