有没有办法在详细信息栏的末尾删除多余的空格?

时间:2019-04-13 07:30:33

标签: jasper-reports

在Jaspersoft Studio中进行报告时,细节区域中的行之后占据了整个页面的大部分空白。

我已经尝试过调整内部元素以及细节区域本身的大小。我也尝试在详细信息区域中使用splitType =“ stretch”。 我也从这些链接尝试了各种解决方案: Jaspersoft : Extra space at the end of table in detail band

https://community.jaspersoft.com/wiki/report-structure-jaspersoft-studio

https://community.jaspersoft.com/questions/801706/how-remove-empty-space-when-there-no-data-detail-band-2

这是我的代码:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.6.0.final using JasperReports Library version 6.6.0  -->
<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="Blank_A4" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="ca464a7f-0159-4974-9789-f65f38a28f9a">
    <property name="net.sf.jasperreports.export.html.remove.empty.space.between.rows" value="true"/>
    <property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
    <style name="Table_TH" mode="Opaque" backcolor="#F8F8FF">
        <box>
            <pen lineWidth="0.5" lineColor="#000000"/>
            <topPen lineWidth="0.5" lineColor="#000000"/>
            <leftPen lineWidth="0.5" lineColor="#000000"/>
            <bottomPen lineWidth="0.5" lineColor="#000000"/>
            <rightPen lineWidth="0.5" lineColor="#000000"/>
        </box>
    </style>
    <style name="Table_CH" mode="Opaque" backcolor="#BFBFFF">
        <box>
            <pen lineWidth="0.5" lineColor="#000000"/>
            <topPen lineWidth="0.5" lineColor="#000000"/>
            <leftPen lineWidth="0.5" lineColor="#000000"/>
            <bottomPen lineWidth="0.5" lineColor="#000000"/>
            <rightPen lineWidth="0.5" lineColor="#000000"/>
        </box>
    </style>
    <subDataset name="Dataset1" uuid="5ab72373-5e9e-4ccc-86c4-5098576c0bf2">
        <queryString>
            <![CDATA[]]>
        </queryString>
    </subDataset>
    <queryString>
        <![CDATA[]]>
    </queryString>
    <field name="orderId" class="java.lang.String"/>
    <field name="orderDate" class="java.lang.String"/>
    <field name="orderStatus" class="java.lang.String"/>
    <field name="address1" class="java.lang.String"/>
    <field name="address2" class="java.lang.String"/>
    <field name="address3" class="java.lang.String"/>
    <field name="deliveryOptions" class="java.lang.String"/>
    <field name="recipientName" class="java.lang.String"/>
    <field name="itemName" class="java.lang.String"/>
    <field name="itemDesc" class="java.lang.String"/>
    <field name="itemComp" class="java.lang.String"/>
    <field name="quantity" class="java.lang.String"/>
    <field name="price" class="java.lang.Long"/>
    <field name="subTotal" class="java.lang.Double"/>
    <field name="discount" class="java.lang.Double"/>
    <field name="deliveryCharge" class="java.lang.Double"/>
    <field name="grandTotal" class="java.lang.Double"/>
    <field name="reportDate" class="java.lang.String"/>
    <background>
        <band splitType="Stretch"/>
    </background>
    <title>
        <band height="70" splitType="Stretch">
            <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.FreeLayout"/>
            <staticText>
                <reportElement mode="Opaque" x="90" y="0" width="465" height="43" uuid="efb38ec0-534a-444d-ac6d-41840a8ef211"/>
                <box>
                    <bottomPen lineWidth="1.0"/>
                </box>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font size="12"/>
                </textElement>
                <text><![CDATA[ORDER DETAILS]]></text>
            </staticText>
            <image>
                <reportElement x="2" y="0" width="88" height="43" uuid="000e791e-970a-42e0-92a0-fe9ce5484139"/>
                <box>
                    <bottomPen lineWidth="1.0"/>
                </box>
                <imageExpression><![CDATA["http://206.189.150.18/assets/image/logo-r.jpg"]]></imageExpression>
            </image>
        </band>
    </title>
    <pageHeader>
        <band height="123" splitType="Stretch">
            <staticText>
                <reportElement x="0" y="0" width="90" height="20" uuid="1e24640a-4346-4457-88b2-520a2dc9398b"/>
                <textElement>
                    <font isBold="true"/>
                </textElement>
                <text><![CDATA[ORDER ID:]]></text>
            </staticText>
            <staticText>
                <reportElement x="0" y="20" width="90" height="20" uuid="129ad656-b2e5-45e1-8bcb-8b2533b27ef0"/>
                <textElement>
                    <font isBold="true"/>
                </textElement>
                <text><![CDATA[ORDER DATE:]]></text>
            </staticText>
            <staticText>
                <reportElement x="0" y="40" width="90" height="20" uuid="33dc6be2-694e-4738-967a-ae0cd78576c9"/>
                <textElement>
                    <font isBold="true"/>
                </textElement>
                <text><![CDATA[ORDER STATUS:]]></text>
            </staticText>
            <textField>
                <reportElement x="90" y="0" width="150" height="20" uuid="9b62a2a6-690e-4fe1-aa02-4faee3afb15f"/>
                <textFieldExpression><![CDATA[$F{orderId}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="90" y="20" width="150" height="20" uuid="ced56a0d-cbfa-4160-ad03-9824c03f1726"/>
                <textFieldExpression><![CDATA[$F{orderDate}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="90" y="40" width="150" height="20" uuid="64df0671-ea86-4bde-99be-8d3b429cc0c1"/>
                <textFieldExpression><![CDATA[$F{orderStatus}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="280" y="40" width="275" height="13" uuid="f4a99b8b-7b42-443b-a61e-16c9dde57499"/>
                <textFieldExpression><![CDATA[$F{address1}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="280" y="53" width="275" height="17" uuid="58e3139b-96d7-44b4-ac9d-f57068bbf0b9"/>
                <textFieldExpression><![CDATA[$F{address2}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="280" y="71" width="275" height="19" uuid="623fd913-79fc-46d1-ba26-ad0a317b5ccc"/>
                <textFieldExpression><![CDATA[$F{address3}]]></textFieldExpression>
            </textField>
            <staticText>
                <reportElement x="280" y="90" width="130" height="15" uuid="9a5d8816-167f-408f-80d8-8197ba6b49cc"/>
                <textElement>
                    <font isBold="true"/>
                </textElement>
                <text><![CDATA[DELIVERY OPTIONS:]]></text>
            </staticText>
            <staticText>
                <reportElement x="280" y="0" width="275" height="20" uuid="a50f7dd2-712c-4af1-ae5d-28a006bfb2c4"/>
                <textElement>
                    <font isBold="true"/>
                </textElement>
                <text><![CDATA[DELIVERY ADDRESS:]]></text>
            </staticText>
            <textField>
                <reportElement x="410" y="90" width="145" height="15" uuid="20f94c37-7b12-45d8-aaa3-ece14977a373"/>
                <textFieldExpression><![CDATA[$F{deliveryOptions}]]></textFieldExpression>
            </textField>
            <staticText>
                <reportElement x="0" y="102" width="107" height="21" uuid="00a5f82b-44bd-4242-985b-a8d72fd8e518"/>
                <textElement>
                    <font isBold="true"/>
                </textElement>
                <text><![CDATA[ITEMS ORDERED:]]></text>
            </staticText>
            <textField>
                <reportElement x="280" y="20" width="275" height="20" uuid="0f68bd76-176f-408a-b7ad-e1d7e2d5f5d5"/>
                <textFieldExpression><![CDATA[$F{recipientName}]]></textFieldExpression>
            </textField>
        </band>
    </pageHeader>
    <columnHeader>
        <band height="34" splitType="Stretch">
            <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.FreeLayout"/>
            <staticText>
                <reportElement mode="Opaque" x="0" y="0" width="330" height="34" uuid="93ed89dd-d75f-4e54-a98d-1e3aa9df5af1"/>
                <box>
                    <bottomPen lineWidth="1.0"/>
                </box>
                <textElement verticalAlignment="Bottom"/>
                <text><![CDATA[ITEM]]></text>
            </staticText>
            <staticText>
                <reportElement mode="Opaque" x="330" y="0" width="114" height="34" uuid="7cac9eeb-ab17-468b-953e-0f973c707e47"/>
                <box>
                    <bottomPen lineWidth="1.0"/>
                </box>
                <textElement verticalAlignment="Bottom"/>
                <text><![CDATA[QUANTITY]]></text>
            </staticText>
            <staticText>
                <reportElement mode="Opaque" x="444" y="0" width="111" height="34" uuid="588d4576-1978-40ba-818c-43ce69bedb81"/>
                <box>
                    <bottomPen lineWidth="1.0"/>
                </box>
                <textElement verticalAlignment="Bottom"/>
                <text><![CDATA[PRICE]]></text>
            </staticText>
        </band>
    </columnHeader>
    <detail>
        <band height="40" splitType="Stretch">
            <textField>
                <reportElement x="0" y="0" width="330" height="20" uuid="bff3db44-2211-4c08-bb76-cb05895dd5a5"/>
                <textElement>
                    <font isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{itemName}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="330" y="0" width="114" height="20" uuid="7e0c4785-dac6-4486-b8f9-163dc0f29c38"/>
                <textFieldExpression><![CDATA[$F{quantity}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="444" y="0" width="106" height="20" uuid="f3492ced-0ec5-4070-acdb-4cc708cbedc5"/>
                <textFieldExpression><![CDATA[$F{price}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="2" y="20" width="118" height="20" uuid="b70a37b5-a0d1-4b41-b639-7aa5d5c43ba1"/>
                <textFieldExpression><![CDATA[$F{itemDesc}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="120" y="20" width="210" height="20" uuid="aea1d68e-ac78-40f1-b15f-e54455be16e2"/>
                <textFieldExpression><![CDATA[$F{itemComp}]]></textFieldExpression>
            </textField>
        </band>
    </detail>
    <columnFooter>
        <band height="90" splitType="Stretch">
            <staticText>
                <reportElement x="330" y="0" width="114" height="20" uuid="8d91e797-2fd7-4f58-be15-e25a0c2b1abc"/>
                <text><![CDATA[ITEM(S) SUBTOTAL]]></text>
            </staticText>
            <textField>
                <reportElement x="444" y="0" width="111" height="20" uuid="5bed25cc-2ec6-4392-a60a-c7f11e5918b3"/>
                <textFieldExpression><![CDATA[$F{subTotal}]]></textFieldExpression>
            </textField>
            <staticText>
                <reportElement x="330" y="20" width="114" height="20" uuid="95a3eb13-8bf7-44fa-a3f4-6b9764b0b020"/>
                <text><![CDATA[DISCOUNT]]></text>
            </staticText>
            <staticText>
                <reportElement x="330" y="40" width="114" height="20" uuid="b585071c-c466-400f-bfb7-2ca56789b392"/>
                <text><![CDATA[DELIVERY CHARGE]]></text>
            </staticText>
            <staticText>
                <reportElement x="330" y="60" width="114" height="30" uuid="6cfa176a-2351-4e10-a899-d9d6fe035df4"/>
                <textElement verticalAlignment="Middle">
                    <font isBold="true"/>
                </textElement>
                <text><![CDATA[GRAND TOTAL]]></text>
            </staticText>
            <textField>
                <reportElement x="444" y="60" width="111" height="30" uuid="f72642ff-a906-4db3-91f0-a62c14bfef5e"/>
                <box>
                    <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
                    <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
                    <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                </box>
                <textElement verticalAlignment="Middle"/>
                <textFieldExpression><![CDATA[$F{grandTotal}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="444" y="20" width="111" height="20" uuid="8b780d5b-5080-4a4d-adcb-61540143bbcd"/>
                <textFieldExpression><![CDATA[$F{discount}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="444" y="40" width="111" height="20" uuid="237fa432-93c0-466c-8112-eed3e879a22e"/>
                <textFieldExpression><![CDATA[$F{deliveryCharge}]]></textFieldExpression>
            </textField>
        </band>
    </columnFooter>
    <pageFooter>
        <band height="93" splitType="Stretch">
            <staticText>
                <reportElement x="1" y="0" width="179" height="30" uuid="1e443095-e63c-4304-ab09-2b8c58f37096"/>
                <textElement>
                    <font isBold="true"/>
                </textElement>
                <text><![CDATA[PAYMENT INFORMATION:]]></text>
            </staticText>
            <staticText>
                <reportElement x="180" y="0" width="200" height="30" uuid="7377fe38-6ea9-428e-b89d-73aa9a127761"/>
                <text><![CDATA[PAID BY CREDIT CARD ENDING IN XXXX]]></text>
            </staticText>
            <staticText>
                <reportElement x="0" y="30" width="180" height="20" uuid="de569ed4-ffb2-47a8-b045-3f19aab05799"/>
                <textElement>
                    <font isItalic="true"/>
                </textElement>
                <text><![CDATA[Please Note: This is not a GST Invoice]]></text>
            </staticText>
            <textField>
                <reportElement x="180" y="50" width="375" height="20" uuid="28f2871d-b676-46d8-aea4-9e7237e81cc3"/>
                <box>
                    <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                </box>
                <textFieldExpression><![CDATA[$F{reportDate}]]></textFieldExpression>
            </textField>
            <staticText>
                <reportElement x="0" y="50" width="177" height="20" uuid="b482f78a-d0f2-4416-90cd-f3e3fe2776d3"/>
                <box>
                    <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                </box>
                <text><![CDATA[This order summary was generated on:]]></text>
            </staticText>
            <staticText>
                <reportElement x="0" y="70" width="280" height="20" uuid="ef3ab371-76a1-49ea-9707-f459758d615e"/>
                <box>
                    <topPen lineWidth="1.0"/>
                </box>
                <text><![CDATA[Need Help? ]]></text>
            </staticText>
            <staticText>
                <reportElement x="280" y="70" width="275" height="20" uuid="de4be6e6-2ad4-4d72-bc74-1165f457ad05"/>
                <box>
                    <topPen lineWidth="1.0"/>
                </box>
                <text><![CDATA[]]></text>
            </staticText>
        </band>
    </pageFooter>
</jasperReport>

此外,我可能听起来含糊不清,因此,我发布了2个屏幕截图以说明我的观点。 This is how I made it look like in the jaspersoft studio

This is how it looks in the preview. Note the whitespace in between the page.

我要寻找的是根据行数动态更改其大小的帐单。

[EDIT]:正如我之前已经提到的,我尝试更改乐队的高度。但是,它不起作用。

0 个答案:

没有答案