How to stretch correctly with overflow for non-standard range

I have page header and page header fields that have multiple lines. I want them to stretch vertically, but there is no problem in the box below the stretched box. I also grouped them using a frame.

Properties that I set:

Position Type : Float
Stretch Type : Relative to Tallest Object
Stretch With Overflow : True

Please see screenshot. enter image description here

+4
source share
3 answers

You can try these text properties: -

For the first field (checkout name) of the header group, use the following properties: -

Position Type-         Fix Relative to Top

Stretch Type-          Relative to Band Height

Stretch With Overflow -    true

For the second field (Date), set these properties

Position Type-         Fix Relative to Bottom

Stretch Type-          No stretch

Stretch With Overflow-     false

In this report, you can see the properties if you run the report using the Sample HSQL database in ireport: -

<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="ward utilization" pageWidth="300" pageHeight="300" orientation="Landscape" columnWidth="280" leftMargin="10" rightMargin="10" topMargin="10" bottomMargin="10" uuid="85476864-df43-454c-83dd-9c1b475ec223">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<queryString>
    <![CDATA[select * from orders]]>
</queryString>
<field name="ORDERID" class="java.lang.Integer"/>
<field name="CUSTOMERID" class="java.lang.String"/>
<field name="EMPLOYEEID" class="java.lang.Integer"/>
<field name="ORDERDATE" class="java.sql.Timestamp"/>
<field name="REQUIREDDATE" class="java.sql.Timestamp"/>
<field name="SHIPPEDDATE" class="java.sql.Timestamp"/>
<field name="SHIPVIA" class="java.lang.Integer"/>
<field name="FREIGHT" class="java.math.BigDecimal"/>
<field name="SHIPNAME" class="java.lang.String"/>
<field name="SHIPADDRESS" class="java.lang.String"/>
<field name="SHIPCITY" class="java.lang.String"/>
<field name="SHIPREGION" class="java.lang.String"/>
<field name="SHIPPOSTALCODE" class="java.lang.String"/>
<field name="SHIPCOUNTRY" class="java.lang.String"/>
<group name="bed"/>
<title>
    <band height="42">
        <textField isStretchWithOverflow="true">
            <reportElement uuid="c438eefe-5415-409e-8e7c-c763a7305ae2" stretchType="RelativeToBandHeight" x="87" y="0" width="24" height="20"/>
            <textElement/>
            <textFieldExpression><![CDATA[$F{SHIPNAME}]]></textFieldExpression>
        </textField>
        <textField>
            <reportElement uuid="83c8a0d7-af5f-43ec-88dd-7d923a5b2a28" positionType="FixRelativeToBottom" x="87" y="21" width="24" height="20"/>
            <textElement/>
            <textFieldExpression><![CDATA[$F{SHIPCITY}]]></textFieldExpression>
        </textField>
    </band>
</title>

+8
source

.

  • , , float, ( ). , , .

  • . , , .

, . , . :)

.

+3

Stretch Type: Tallest Object . () .

It is not necessary. Set stretch type = "No stretch". "Stretch with overflow = true" is enough to display elements correctly. (IMHO)

Decision. Place each pair label: field in a separate frame. In this case, the field labels will be displayed in the corresponding lines.

+3
source

Source: https://habr.com/ru/post/1546252/


All Articles