whitespace in reports

0

We have reports that include multiple subreports, and we may not know which subreports until runtime so they are included as fields in the main report. This all works fine and dandy except... We seem to have no control over whitespace between the subreports. Each subreport is individually as small as possible, although they may stretch depending on the data. Each subreport and the main report has all unused bands set to zero height. The main report includes the subreport element with positionType=Float. I have looked through the forum and reread the Ultimate Guide, but still no answers. The amount of whitespace seems to change from report to report -- I can't determine what it is related to. How does jasperreport decide how much whitespace to include between sections? What control over the process do I have? Help!! JasperReports1.3.4 Java1.5.0 JBoss4.0.5 Eclipse3.1.2 iReports2.0.1 CSW3.4 VespaP200 Many thanks, Jonathan [file name=Report.jrxml size=12413]

orbwen's picture
4
Joined: Jan 2 2007 - 9:14am
Last seen: 7 years 10 months ago

4 Answers:

0
A full and self-contained sample would help understanding what's going on. Other things that you should play attention to are subreport page margins. Regards, Lucian
lucianc's picture
5279
Joined: Jul 17 2006 - 1:10am
Last seen: 2 months 4 days ago
0

Thanks for the reply! I just checked -- subreport page margins are all set to zero. I have attached an example to demonstrate the problem. The main report includes the first subreport twice, then the second subreport twice. In the PDF you can see extra whitespace added below the first two subreports, but not in the second. The main report xml is in my first post. The subreport above the added whitespace is called PatientInfo5line.jrxml. The PDF is called whitespace.pdf. iReport does not show any additional whitespace in the PatientInfo5line.jrxml and I can't find anything in the XML to explain it! [file name=PatientInfo5line.jrxml size=19794]

orbwen's picture
4
Joined: Jan 2 2007 - 9:14am
Last seen: 7 years 10 months ago
0

Sorry, it didn't accept the PDF as an image. Here is the attached result showing the whitespace. [file name=whitespace.pdf size=53784]

orbwen's picture
4
Joined: Jan 2 2007 - 9:14am
Last seen: 7 years 10 months ago
0
The white space is caused by the fact that the (invisible) $P{LocationAddress} text field and the $P{LocationAddress1} text field stretch, and in this case the engine pushes down the empty space between the stretching text fields and the bottom of the report band. I don't understand how the report layout is meant to work; for instance $P{LocationAddress1} is set to stretch, but there are text fields beneath it that do not have positionType="Float", so the $P{LocationAddress1} would stretch over these text fields. Anyway, try to increase the height of the stretching text fields to prevent the white space from appearing. Regards, Lucian
lucianc's picture
5279
Joined: Jul 17 2006 - 1:10am
Last seen: 2 months 4 days ago
Feedback