当WhenPrintExpression为false时,如何删除空白行? [英] How to remove blank lines in case when WhenPrintExpression is false?

查看:194
本文介绍了当WhenPrintExpression为false时,如何删除空白行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用JasperReports 6.6.

我使用条件表达式来显示某些参数.该行为是预期的. 但是,当不打印时,仍然有空白行.

这两个领域彼此不接触,我很小心.全部是RemoveLineWhenBlank.当条件不正确时,由于不显示表达式内容,因此在没有表达式起作用时打印.其他元素是浮点型.

尝试

我尝试了其他答案的解决方案,但与我的情况不符.我已经尝试过了.我将详细解释:

1)从Jasper报告中删除空白条目

对于这个,我不能使用框架.我已经尝试过,但是不幸的是,我没有成功允许在几页上显示框架.然后,当我的框架超过某个特定尺寸时,它将直接进入另一页.这不是我所期望的.

关于这个问题,我问了一个问题,但没有得到任何答案:如何用碧玉将框架分成几页?

2) iReport:删除行后重新定位元素

在这里,正如我在问题开始时所说的那样,我遵守以下要求:-文本字段的值为空-选中文本字段的空白时删除行"-文本字段的位置类型设置为浮动"-文本字段未触摸彼此

唯一的区别是我的值不一定是空的,例如与任何值都不相关的标签.但是它们上有PrintWhenExpression条件.

3) iReport :如何在没有数据行的情况下隐藏带有文本字段的行

如何删除具有空textFields的框架?

没有参数的JRXML样本:

我的问题仅限于处置特性"内容部分.您可以在源代码中看到此内容的PrintWhenExpression设置为false,并且它不会出现并且留有空白行.

<?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="revueDeCompte" pageWidth="595" pageHeight="842" columnWidth="511" leftMargin="42" rightMargin="42" topMargin="20" bottomMargin="20" uuid="e40ca3dd-a126-4201-ba2e-02fad2685c5a">
    <property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
    <property name="com.jaspersoft.studio.unit." value="pixel"/>
    <property name="com.jaspersoft.studio.unit.pageHeight" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.pageWidth" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.topMargin" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.bottomMargin" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.leftMargin" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.rightMargin" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/>
    <parameter name="logo" class="Object" isForPrompting="false">
        <parameterDescription><![CDATA[Logo de la société]]></parameterDescription>
    </parameter>
    <queryString>
        <![CDATA[]]>
    </queryString>
    <background>
        <band splitType="Stretch"/>
    </background>
    <title>
        <band height="79" splitType="Stretch"/>
    </title>
    <pageHeader>
        <band height="50"/>
    </pageHeader>
    <detail>
        <band height="96" splitType="Stretch">
            <staticText>
                <reportElement x="0" y="1" width="148" height="30" uuid="76987bd1-0e7e-44f6-a4ee-aa0783847905"/>
                <textElement textAlignment="Left" verticalAlignment="Middle">
                    <font size="14" isBold="true" isUnderline="true"/>
                </textElement>
                <text><![CDATA[REVUE DE COMPTE :]]></text>
            </staticText>
            <staticText>
                <reportElement x="0" y="31" width="110" height="18" uuid="13afa98d-e049-41d9-a6de-4fcb461d589b"/>
                <textElement>
                    <font size="12" isBold="true" isUnderline="true"/>
                </textElement>
                <text><![CDATA[Type : ]]></text>
            </staticText>
            <staticText>
                <reportElement x="0" y="52" width="110" height="18" uuid="9a6e28b4-e6e5-4f68-8e3d-e163a5610d5e"/>
                <textElement>
                    <font size="12" isBold="true" isUnderline="true"/>
                </textElement>
                <text><![CDATA[Responsable TVy :]]></text>
            </staticText>
            <staticText>
                <reportElement x="0" y="73" width="110" height="18" uuid="05c1e5bc-093f-4a63-82fd-44faef979f62"/>
                <textElement>
                    <font size="12" isBold="true" isUnderline="true"/>
                </textElement>
                <text><![CDATA[Groupe :]]></text>
            </staticText>
        </band>
        <band height="681">
            <staticText>
                <reportElement positionType="Float" x="10" y="43" width="140" height="18" uuid="d7d5535f-f538-4535-aaee-566ec690f97d"/>
                <textElement>
                    <font size="12" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Fichier descriptif :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" x="10" y="63" width="140" height="18" uuid="b0d26808-d829-49bb-ab7d-a46992abb6ff"/>
                <textElement>
                    <font size="12" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Contrat cadre :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" x="10" y="23" width="140" height="18" uuid="7fca0ca7-09e7-491e-9d7d-85bddb9bbefc"/>
                <textElement>
                    <font size="12" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Onglet généralité :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" x="0" y="2" width="200" height="18" uuid="a2a2787d-6685-442f-a630-08a0e9ee9a43"/>
                <textElement>
                    <font size="12" isBold="true" isUnderline="true"/>
                </textElement>
                <text><![CDATA[Fiche société client dans MTV : ]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" x="10" y="83" width="140" height="18" uuid="dbe422df-12d8-42a9-aa3b-9d83df0f50f4"/>
                <textElement>
                    <font size="12" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Entités client :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" x="10" y="123" width="140" height="18" uuid="d9bb820b-402e-46e5-b624-6626be5bc81c"/>
                <textElement>
                    <font size="12" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Dispositions facturation :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" isPrintRepeatedValues="false" x="30" y="143" width="130" height="18" isRemoveLineWhenBlank="true" uuid="28be9fae-fd4e-4156-9938-71c2f5884f85">
                    <printWhenExpression><![CDATA[false]]></printWhenExpression>
                </reportElement>
                <textElement>
                    <font size="10" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[TVA :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" isPrintRepeatedValues="false" x="30" y="163" width="130" height="18" isRemoveLineWhenBlank="true" uuid="14923714-00fe-4263-bffd-d81cf11f0ecf">
                    <printWhenExpression><![CDATA[false]]></printWhenExpression>
                </reportElement>
                <textElement>
                    <font size="10" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Numéro comptable :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" isPrintRepeatedValues="false" x="30" y="183" width="130" height="18" isRemoveLineWhenBlank="true" uuid="8343a99d-8da3-436e-8ee7-d9b9b47eb5b7">
                    <printWhenExpression><![CDATA[false]]></printWhenExpression>
                </reportElement>
                <textElement>
                    <font size="10" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Délai règlement :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" isPrintRepeatedValues="false" x="30" y="203" width="130" height="18" isRemoveLineWhenBlank="true" uuid="01e27294-8e0e-4645-bfd6-38b7870fb7fb">
                    <printWhenExpression><![CDATA[false]]></printWhenExpression>
                </reportElement>
                <textElement>
                    <font size="10" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Conditions règlement :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" isPrintRepeatedValues="false" x="30" y="223" width="130" height="18" isRemoveLineWhenBlank="true" uuid="1a59cabe-8998-4ca7-af0f-e67dd8ef7a67">
                    <printWhenExpression><![CDATA[false]]></printWhenExpression>
                </reportElement>
                <textElement>
                    <font size="10" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Type envoi facture :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" isPrintRepeatedValues="false" x="30" y="243" width="130" height="18" isRemoveLineWhenBlank="true" uuid="dc66bc38-2120-4b64-97cc-945e623bf2c2">
                    <printWhenExpression><![CDATA[false]]></printWhenExpression>
                </reportElement>
                <textElement>
                    <font size="10" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Adresse facturation :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" isPrintRepeatedValues="false" x="30" y="263" width="130" height="18" isRemoveLineWhenBlank="true" uuid="9ba512ca-ef68-44c5-8e19-58e57e2d980d">
                    <printWhenExpression><![CDATA[false]]></printWhenExpression>
                </reportElement>
                <textElement>
                    <font size="10" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Mails destinataires factures :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" isPrintRepeatedValues="false" x="30" y="283" width="130" height="18" isRemoveLineWhenBlank="true" uuid="c93554c7-e10e-4eaf-917b-c024ec204ddf">
                    <printWhenExpression><![CDATA[false]]></printWhenExpression>
                </reportElement>
                <textElement>
                    <font size="10" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Mails copies factures :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" isPrintRepeatedValues="false" x="30" y="303" width="130" height="18" isRemoveLineWhenBlank="true" uuid="d0d6d749-a384-48b0-8649-25b544a8d6bf">
                    <printWhenExpression><![CDATA[false]]></printWhenExpression>
                </reportElement>
                <textElement>
                    <font size="10" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Adresse envoi courrier :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" isPrintRepeatedValues="false" x="30" y="324" width="130" height="18" isRemoveLineWhenBlank="true" uuid="0b30dc0a-d562-4114-8f32-1b0a2dd26692">
                    <printWhenExpression><![CDATA[false]]></printWhenExpression>
                </reportElement>
                <textElement>
                    <font size="10" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Pièces factures :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" isPrintRepeatedValues="false" x="30" y="344" width="130" height="18" isRemoveLineWhenBlank="true" uuid="7ef51faa-5beb-4f00-ae3c-c80a9aeb6e84">
                    <printWhenExpression><![CDATA[false]]></printWhenExpression>
                </reportElement>
                <textElement>
                    <font size="10" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Titre facture :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" isPrintRepeatedValues="false" x="30" y="364" width="130" height="18" isRemoveLineWhenBlank="true" uuid="cc4afcff-67c1-4426-8455-fe909f421492">
                    <printWhenExpression><![CDATA[false]]></printWhenExpression>
                </reportElement>
                <textElement>
                    <font size="10" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Commentaire tva facture :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" isPrintRepeatedValues="false" x="30" y="384" width="130" height="18" isRemoveLineWhenBlank="true" uuid="5cfb7ae1-3ef3-425e-b9ed-3e62187aefbb">
                    <printWhenExpression><![CDATA[false]]></printWhenExpression>
                </reportElement>
                <textElement>
                    <font size="10" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Référence contrat cadre :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" isPrintRepeatedValues="false" x="30" y="404" width="130" height="18" isRemoveLineWhenBlank="true" uuid="cf7afd97-e009-4bf7-8a87-17c34198e8f8">
                    <printWhenExpression><![CDATA[false]]></printWhenExpression>
                </reportElement>
                <textElement>
                    <font size="10" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Référence fournisseur TV :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" isPrintRepeatedValues="false" x="30" y="423" width="130" height="18" isRemoveLineWhenBlank="true" uuid="cbce1351-94c1-4fca-8382-bae70a80c551">
                    <printWhenExpression><![CDATA[false]]></printWhenExpression>
                </reportElement>
                <textElement>
                    <font size="10" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Mails relance commande :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" isPrintRepeatedValues="false" x="30" y="463" width="130" height="18" isRemoveLineWhenBlank="true" uuid="6456e941-a4a5-40ae-8929-b4b2b3c6e0ab">
                    <printWhenExpression><![CDATA[false]]></printWhenExpression>
                </reportElement>
                <textElement>
                    <font size="10" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Mails relance règlement :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" x="0" y="504" width="200" height="18" uuid="50b8b039-07eb-4444-9149-d8e3b892196a"/>
                <textElement>
                    <font size="12" isBold="true" isUnderline="true"/>
                </textElement>
                <text><![CDATA[Fiche Contacts clients dans MTV : ]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" x="10" y="525" width="140" height="18" isRemoveLineWhenBlank="true" uuid="b5c26cae-d87c-4e37-b309-e757495e56a7"/>
                <textElement>
                    <font size="12" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Contacts dirigeants :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" x="10" y="565" width="140" height="18" isRemoveLineWhenBlank="true" uuid="74b40a0b-fb21-4dc0-9945-352192be69f9"/>
                <textElement>
                    <font size="12" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Managers d'entité :]]></text>
            </staticText>
        </band>
    </detail>
    <pageFooter>
        <band height="71">
            <textField>
                <reportElement x="160" y="20" width="100" height="30" uuid="610924a5-4d05-4edc-bebf-a8abf14f274e"/>
                <textElement textAlignment="Right"/>
                <textFieldExpression><![CDATA["Page " + $V{PAGE_NUMBER}]]></textFieldExpression>
            </textField>
            <textField evaluationTime="Report">
                <reportElement x="260" y="20" width="100" height="30" uuid="5acae58f-ec6d-4074-b37a-4a1f0853f30b"/>
                <textElement textAlignment="Left"/>
                <textFieldExpression><![CDATA[" sur " + $V{PAGE_NUMBER}]]></textFieldExpression>
            </textField>
        </band>
    </pageFooter>
</jasperReport>

在这种尝试中,这就是我想要的:

这就是我得到的:

能帮我让那些空白行消失吗?

解决方案

出了什么问题

每个相邻元素之间的垂直间距很小.

是的,它很小(只有 3px ),但是已经存在.

如何修复

我更改了所有元素的 y 位置.我消除了这个空白:

元素的y位置=上一个元素的(y位置+高度)

这样做,我将 98 px 保存为管理人员身份:" 标签.是的,不是太多,但是因此没有更多的新页面.

修改后的设计如下:

经过一点修改的模板的输出结果是:

目前,如果要删除元素,则下面的所有元素都将被拉出而没有任何问题.

这是JasperReports引擎的工作方式.您必须使用此规则进行游戏.

We are using JasperReports 6.6.

I use conditional expression to display certain parameters. The behaviour is as expected. However, when it is not printed, there is still blank line space. 

The fields are not touching each other, I took care. There are all isRemoveLineWhenBlank. Print when no expression is functionnal since the expression content is not displayed when the condition is not ok. The other elements are float type.

TRY

I tried solutions from other answers but do not correspond to my situation. I already tried them. I will explain more in details:

1) Removing blank entries from a Jasper report

For this one, I can't use frame. I already tried but unfortunately, I don't succeed to allow frame on several pages. Then, when my frame is above a certain treshold size, it goes directly onto another page. This is not what I expect.

About this issue, I asked a question but never get any answer: How to split a frame in several pages with jasper?

2) iReport: reposition elements after removeing line

Here, as I say at the beginning of my issue, I respect the requirements: - Textfield's value is empty - Textfield's "Remove line when blank" is checked - Textfield's Position type is setted to "Float" - Textfields are not touching each other

The only difference is that my values are not necessarily empty, such as the labels which are not related to any value. But there is the PrintWhenExpression condition on them.

3) iReport: How to hide line with text fields without data line contains different kind of data

How to remove frame with empty textFields?

JRXML SAMPLE with no parameters:

My problem is localized in the "Dispositions Facturation" content part. You can see in the source that the PrintWhenExpression is set to false for this content, and it does not appear and a blank line is left.

<?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="revueDeCompte" pageWidth="595" pageHeight="842" columnWidth="511" leftMargin="42" rightMargin="42" topMargin="20" bottomMargin="20" uuid="e40ca3dd-a126-4201-ba2e-02fad2685c5a">
    <property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
    <property name="com.jaspersoft.studio.unit." value="pixel"/>
    <property name="com.jaspersoft.studio.unit.pageHeight" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.pageWidth" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.topMargin" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.bottomMargin" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.leftMargin" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.rightMargin" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/>
    <property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/>
    <parameter name="logo" class="Object" isForPrompting="false">
        <parameterDescription><![CDATA[Logo de la société]]></parameterDescription>
    </parameter>
    <queryString>
        <![CDATA[]]>
    </queryString>
    <background>
        <band splitType="Stretch"/>
    </background>
    <title>
        <band height="79" splitType="Stretch"/>
    </title>
    <pageHeader>
        <band height="50"/>
    </pageHeader>
    <detail>
        <band height="96" splitType="Stretch">
            <staticText>
                <reportElement x="0" y="1" width="148" height="30" uuid="76987bd1-0e7e-44f6-a4ee-aa0783847905"/>
                <textElement textAlignment="Left" verticalAlignment="Middle">
                    <font size="14" isBold="true" isUnderline="true"/>
                </textElement>
                <text><![CDATA[REVUE DE COMPTE :]]></text>
            </staticText>
            <staticText>
                <reportElement x="0" y="31" width="110" height="18" uuid="13afa98d-e049-41d9-a6de-4fcb461d589b"/>
                <textElement>
                    <font size="12" isBold="true" isUnderline="true"/>
                </textElement>
                <text><![CDATA[Type : ]]></text>
            </staticText>
            <staticText>
                <reportElement x="0" y="52" width="110" height="18" uuid="9a6e28b4-e6e5-4f68-8e3d-e163a5610d5e"/>
                <textElement>
                    <font size="12" isBold="true" isUnderline="true"/>
                </textElement>
                <text><![CDATA[Responsable TVy :]]></text>
            </staticText>
            <staticText>
                <reportElement x="0" y="73" width="110" height="18" uuid="05c1e5bc-093f-4a63-82fd-44faef979f62"/>
                <textElement>
                    <font size="12" isBold="true" isUnderline="true"/>
                </textElement>
                <text><![CDATA[Groupe :]]></text>
            </staticText>
        </band>
        <band height="681">
            <staticText>
                <reportElement positionType="Float" x="10" y="43" width="140" height="18" uuid="d7d5535f-f538-4535-aaee-566ec690f97d"/>
                <textElement>
                    <font size="12" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Fichier descriptif :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" x="10" y="63" width="140" height="18" uuid="b0d26808-d829-49bb-ab7d-a46992abb6ff"/>
                <textElement>
                    <font size="12" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Contrat cadre :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" x="10" y="23" width="140" height="18" uuid="7fca0ca7-09e7-491e-9d7d-85bddb9bbefc"/>
                <textElement>
                    <font size="12" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Onglet généralité :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" x="0" y="2" width="200" height="18" uuid="a2a2787d-6685-442f-a630-08a0e9ee9a43"/>
                <textElement>
                    <font size="12" isBold="true" isUnderline="true"/>
                </textElement>
                <text><![CDATA[Fiche société client dans MTV : ]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" x="10" y="83" width="140" height="18" uuid="dbe422df-12d8-42a9-aa3b-9d83df0f50f4"/>
                <textElement>
                    <font size="12" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Entités client :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" x="10" y="123" width="140" height="18" uuid="d9bb820b-402e-46e5-b624-6626be5bc81c"/>
                <textElement>
                    <font size="12" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Dispositions facturation :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" isPrintRepeatedValues="false" x="30" y="143" width="130" height="18" isRemoveLineWhenBlank="true" uuid="28be9fae-fd4e-4156-9938-71c2f5884f85">
                    <printWhenExpression><![CDATA[false]]></printWhenExpression>
                </reportElement>
                <textElement>
                    <font size="10" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[TVA :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" isPrintRepeatedValues="false" x="30" y="163" width="130" height="18" isRemoveLineWhenBlank="true" uuid="14923714-00fe-4263-bffd-d81cf11f0ecf">
                    <printWhenExpression><![CDATA[false]]></printWhenExpression>
                </reportElement>
                <textElement>
                    <font size="10" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Numéro comptable :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" isPrintRepeatedValues="false" x="30" y="183" width="130" height="18" isRemoveLineWhenBlank="true" uuid="8343a99d-8da3-436e-8ee7-d9b9b47eb5b7">
                    <printWhenExpression><![CDATA[false]]></printWhenExpression>
                </reportElement>
                <textElement>
                    <font size="10" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Délai règlement :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" isPrintRepeatedValues="false" x="30" y="203" width="130" height="18" isRemoveLineWhenBlank="true" uuid="01e27294-8e0e-4645-bfd6-38b7870fb7fb">
                    <printWhenExpression><![CDATA[false]]></printWhenExpression>
                </reportElement>
                <textElement>
                    <font size="10" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Conditions règlement :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" isPrintRepeatedValues="false" x="30" y="223" width="130" height="18" isRemoveLineWhenBlank="true" uuid="1a59cabe-8998-4ca7-af0f-e67dd8ef7a67">
                    <printWhenExpression><![CDATA[false]]></printWhenExpression>
                </reportElement>
                <textElement>
                    <font size="10" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Type envoi facture :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" isPrintRepeatedValues="false" x="30" y="243" width="130" height="18" isRemoveLineWhenBlank="true" uuid="dc66bc38-2120-4b64-97cc-945e623bf2c2">
                    <printWhenExpression><![CDATA[false]]></printWhenExpression>
                </reportElement>
                <textElement>
                    <font size="10" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Adresse facturation :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" isPrintRepeatedValues="false" x="30" y="263" width="130" height="18" isRemoveLineWhenBlank="true" uuid="9ba512ca-ef68-44c5-8e19-58e57e2d980d">
                    <printWhenExpression><![CDATA[false]]></printWhenExpression>
                </reportElement>
                <textElement>
                    <font size="10" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Mails destinataires factures :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" isPrintRepeatedValues="false" x="30" y="283" width="130" height="18" isRemoveLineWhenBlank="true" uuid="c93554c7-e10e-4eaf-917b-c024ec204ddf">
                    <printWhenExpression><![CDATA[false]]></printWhenExpression>
                </reportElement>
                <textElement>
                    <font size="10" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Mails copies factures :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" isPrintRepeatedValues="false" x="30" y="303" width="130" height="18" isRemoveLineWhenBlank="true" uuid="d0d6d749-a384-48b0-8649-25b544a8d6bf">
                    <printWhenExpression><![CDATA[false]]></printWhenExpression>
                </reportElement>
                <textElement>
                    <font size="10" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Adresse envoi courrier :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" isPrintRepeatedValues="false" x="30" y="324" width="130" height="18" isRemoveLineWhenBlank="true" uuid="0b30dc0a-d562-4114-8f32-1b0a2dd26692">
                    <printWhenExpression><![CDATA[false]]></printWhenExpression>
                </reportElement>
                <textElement>
                    <font size="10" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Pièces factures :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" isPrintRepeatedValues="false" x="30" y="344" width="130" height="18" isRemoveLineWhenBlank="true" uuid="7ef51faa-5beb-4f00-ae3c-c80a9aeb6e84">
                    <printWhenExpression><![CDATA[false]]></printWhenExpression>
                </reportElement>
                <textElement>
                    <font size="10" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Titre facture :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" isPrintRepeatedValues="false" x="30" y="364" width="130" height="18" isRemoveLineWhenBlank="true" uuid="cc4afcff-67c1-4426-8455-fe909f421492">
                    <printWhenExpression><![CDATA[false]]></printWhenExpression>
                </reportElement>
                <textElement>
                    <font size="10" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Commentaire tva facture :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" isPrintRepeatedValues="false" x="30" y="384" width="130" height="18" isRemoveLineWhenBlank="true" uuid="5cfb7ae1-3ef3-425e-b9ed-3e62187aefbb">
                    <printWhenExpression><![CDATA[false]]></printWhenExpression>
                </reportElement>
                <textElement>
                    <font size="10" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Référence contrat cadre :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" isPrintRepeatedValues="false" x="30" y="404" width="130" height="18" isRemoveLineWhenBlank="true" uuid="cf7afd97-e009-4bf7-8a87-17c34198e8f8">
                    <printWhenExpression><![CDATA[false]]></printWhenExpression>
                </reportElement>
                <textElement>
                    <font size="10" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Référence fournisseur TV :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" isPrintRepeatedValues="false" x="30" y="423" width="130" height="18" isRemoveLineWhenBlank="true" uuid="cbce1351-94c1-4fca-8382-bae70a80c551">
                    <printWhenExpression><![CDATA[false]]></printWhenExpression>
                </reportElement>
                <textElement>
                    <font size="10" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Mails relance commande :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" isPrintRepeatedValues="false" x="30" y="463" width="130" height="18" isRemoveLineWhenBlank="true" uuid="6456e941-a4a5-40ae-8929-b4b2b3c6e0ab">
                    <printWhenExpression><![CDATA[false]]></printWhenExpression>
                </reportElement>
                <textElement>
                    <font size="10" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Mails relance règlement :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" x="0" y="504" width="200" height="18" uuid="50b8b039-07eb-4444-9149-d8e3b892196a"/>
                <textElement>
                    <font size="12" isBold="true" isUnderline="true"/>
                </textElement>
                <text><![CDATA[Fiche Contacts clients dans MTV : ]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" x="10" y="525" width="140" height="18" isRemoveLineWhenBlank="true" uuid="b5c26cae-d87c-4e37-b309-e757495e56a7"/>
                <textElement>
                    <font size="12" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Contacts dirigeants :]]></text>
            </staticText>
            <staticText>
                <reportElement positionType="Float" x="10" y="565" width="140" height="18" isRemoveLineWhenBlank="true" uuid="74b40a0b-fb21-4dc0-9945-352192be69f9"/>
                <textElement>
                    <font size="12" isBold="false" isUnderline="false"/>
                </textElement>
                <text><![CDATA[Managers d'entité :]]></text>
            </staticText>
        </band>
    </detail>
    <pageFooter>
        <band height="71">
            <textField>
                <reportElement x="160" y="20" width="100" height="30" uuid="610924a5-4d05-4edc-bebf-a8abf14f274e"/>
                <textElement textAlignment="Right"/>
                <textFieldExpression><![CDATA["Page " + $V{PAGE_NUMBER}]]></textFieldExpression>
            </textField>
            <textField evaluationTime="Report">
                <reportElement x="260" y="20" width="100" height="30" uuid="5acae58f-ec6d-4074-b37a-4a1f0853f30b"/>
                <textElement textAlignment="Left"/>
                <textFieldExpression><![CDATA[" sur " + $V{PAGE_NUMBER}]]></textFieldExpression>
            </textField>
        </band>
    </pageFooter>
</jasperReport>

In this try, this is what I want:

And this is what I get:

Could you help me to make those blank lines disappear, please?

解决方案

What is wrong

You have a small vertical gap between every neighbours elements.

Yes, it is small (only 3px), but it is exisits.

How to fix

I changed y position of all elements. I removed this gap:

y-position of element = (y-position + height) of previous element

Doing this trick I saved 98 px for "Managers d'entité :" label. Yes, not too much but as a result no more new page.

The modified design looks like this:

The output result for this a little bit modified template is:

For now, in case removing element(s) - the all elements below will be pull out without any issues.

This is how the JasperReports engine works. You have to play using this rules.

这篇关于当WhenPrintExpression为false时,如何删除空白行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆