Sub reports are on top of each other

Asked

Viewed 105 times

1

Hello! My application has to make a report with two sub-reports,one of them stands on top of the other,q is the sub-report of knowledge, someone knows why?

Code report knowledge:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.8.0.final using JasperReports Library version 6.8.0-2ed8dfabb690ff337a5797129f2cd92902b0c87b  -->
<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="SubCo" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="842" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="b13071d7-55cd-4769-a1fc-d58cb7a3c9a6">
    <property name="com.jaspersoft.studio.data.defaultdataadapter" value="Servidor Far"/>
    <parameter name="numeroDocumentoCobranca" class="java.lang.Double"/>
    <queryString>
        <![CDATA[SELECT numero_conhecimento,serie_conhecimento,data_emissao_conhecimento,valor_frete FROM ph161169_fatura_pagar WHERE numero_documento_cobranca = $P{numeroDocumentoCobranca}]]>
    </queryString>
    <field name="serie_conhecimento" class="java.lang.Double"/>
    <field name="numero_conhecimento" class="java.lang.Double"/>
    <field name="data_emissao_conhecimento" class="java.util.Date"/>
    <field name="valor_frete" class="java.lang.String"/>
    <background>
        <band splitType="Stretch"/>
    </background>
    <title>
        <band height="53" splitType="Stretch">
            <staticText>
                <reportElement x="0" y="10" width="160" height="30" uuid="0d28e896-3ec6-47a2-9688-235b65e66ba3"/>
                <textElement>
                    <font size="16" isBold="true"/>
                </textElement>
                <text><![CDATA[Notas Fiscais]]></text>
            </staticText>
        </band>
    </title>
    <columnHeader>
        <band height="40" splitType="Stretch">
            <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.FreeLayout"/>
            <staticText>
                <reportElement x="0" y="0" width="142" height="40" uuid="33c16c28-f3ad-4372-a47d-9dd59cc01735">
                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="eb31812e-f740-4b5a-b134-42877ad91ba3"/>
                </reportElement>
                <textElement>
                    <font size="13" isBold="true"/>
                </textElement>
                <text><![CDATA[Série:]]></text>
            </staticText>
            <staticText>
                <reportElement x="142" y="0" width="140" height="40" uuid="b263fdf0-142a-493d-8db0-b546b2d40cf3">
                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="eb31812e-f740-4b5a-b134-42877ad91ba3"/>
                </reportElement>
                <textElement>
                    <font size="13" isBold="true"/>
                </textElement>
                <text><![CDATA[Número:]]></text>
            </staticText>
            <staticText>
                <reportElement x="282" y="0" width="140" height="40" uuid="c04244bd-420d-4b65-9734-a8bac3e17300">
                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="eb31812e-f740-4b5a-b134-42877ad91ba3"/>
                </reportElement>
                <textElement>
                    <font size="13" isBold="true"/>
                </textElement>
                <text><![CDATA[Data Emissão:]]></text>
            </staticText>
            <staticText>
                <reportElement x="562" y="0" width="140" height="40" uuid="d45efca9-5d54-4556-bab9-18036b2240d5">
                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="eb31812e-f740-4b5a-b134-42877ad91ba3"/>
                </reportElement>
                <textElement>
                    <font size="13" isBold="true"/>
                </textElement>
                <text><![CDATA[Valor frete:]]></text>
            </staticText>
        </band>
    </columnHeader>
    <detail>
        <band height="51" splitType="Stretch">
            <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.FreeLayout"/>
            <textField>
                <reportElement x="0" y="0" width="142" height="51" uuid="5fdaa9f0-9973-4668-b946-1c756439bdd0">
                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="eb31812e-f740-4b5a-b134-42877ad91ba3"/>
                </reportElement>
                <textElement>
                    <font size="12"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{serie_conhecimento}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="142" y="0" width="140" height="51" uuid="092b57e7-2f7c-4686-8462-347c62839e8d">
                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="eb31812e-f740-4b5a-b134-42877ad91ba3"/>
                </reportElement>
                <textElement>
                    <font size="12"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{numero_conhecimento}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="282" y="0" width="140" height="51" uuid="381c9f77-6a2e-4549-9dc2-5d14d9948210">
                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="eb31812e-f740-4b5a-b134-42877ad91ba3"/>
                </reportElement>
                <textElement>
                    <font size="12"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{data_emissao_conhecimento}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="562" y="0" width="140" height="51" uuid="4bd6547a-72e2-4ee8-94ed-7d3104b9e818">
                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="eb31812e-f740-4b5a-b134-42877ad91ba3"/>
                </reportElement>
                <textElement>
                    <font size="12"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{valor_frete}]]></textFieldExpression>
            </textField>
        </band>
    </detail>
    <summary>
        <band height="42" splitType="Stretch"/>
    </summary>
</jasperReport>

Main report code:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.8.0.final using JasperReports Library version 6.8.0-2ed8dfabb690ff337a5797129f2cd92902b0c87b  -->
<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="SubCo" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="842" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="b13071d7-55cd-4769-a1fc-d58cb7a3c9a6">
    <property name="com.jaspersoft.studio.data.defaultdataadapter" value="Servidor Far"/>
    <parameter name="numeroDocumentoCobranca" class="java.lang.Double"/>
    <queryString>
        <![CDATA[SELECT numero_conhecimento,serie_conhecimento,data_emissao_conhecimento,valor_frete FROM ph161169_fatura_pagar WHERE numero_documento_cobranca = $P{numeroDocumentoCobranca}]]>
    </queryString>
    <field name="serie_conhecimento" class="java.lang.Double"/>
    <field name="numero_conhecimento" class="java.lang.Double"/>
    <field name="data_emissao_conhecimento" class="java.util.Date"/>
    <field name="valor_frete" class="java.lang.String"/>
    <background>
        <band splitType="Stretch"/>
    </background>
    <title>
        <band height="53" splitType="Stretch">
            <staticText>
                <reportElement x="0" y="10" width="160" height="30" uuid="0d28e896-3ec6-47a2-9688-235b65e66ba3"/>
                <textElement>
                    <font size="16" isBold="true"/>
                </textElement>
                <text><![CDATA[Notas Fiscais]]></text>
            </staticText>
        </band>
    </title>
    <columnHeader>
        <band height="40" splitType="Stretch">
            <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.FreeLayout"/>
            <staticText>
                <reportElement x="0" y="0" width="142" height="40" uuid="33c16c28-f3ad-4372-a47d-9dd59cc01735">
                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="eb31812e-f740-4b5a-b134-42877ad91ba3"/>
                </reportElement>
                <textElement>
                    <font size="13" isBold="true"/>
                </textElement>
                <text><![CDATA[Série:]]></text>
            </staticText>
            <staticText>
                <reportElement x="142" y="0" width="140" height="40" uuid="b263fdf0-142a-493d-8db0-b546b2d40cf3">
                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="eb31812e-f740-4b5a-b134-42877ad91ba3"/>
                </reportElement>
                <textElement>
                    <font size="13" isBold="true"/>
                </textElement>
                <text><![CDATA[Número:]]></text>
            </staticText>
            <staticText>
                <reportElement x="282" y="0" width="140" height="40" uuid="c04244bd-420d-4b65-9734-a8bac3e17300">
                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="eb31812e-f740-4b5a-b134-42877ad91ba3"/>
                </reportElement>
                <textElement>
                    <font size="13" isBold="true"/>
                </textElement>
                <text><![CDATA[Data Emissão:]]></text>
            </staticText>
            <staticText>
                <reportElement x="562" y="0" width="140" height="40" uuid="d45efca9-5d54-4556-bab9-18036b2240d5">
                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="eb31812e-f740-4b5a-b134-42877ad91ba3"/>
                </reportElement>
                <textElement>
                    <font size="13" isBold="true"/>
                </textElement>
                <text><![CDATA[Valor frete:]]></text>
            </staticText>
        </band>
    </columnHeader>
    <detail>
        <band height="51" splitType="Stretch">
            <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.FreeLayout"/>
            <textField>
                <reportElement x="0" y="0" width="142" height="51" uuid="5fdaa9f0-9973-4668-b946-1c756439bdd0">
                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="eb31812e-f740-4b5a-b134-42877ad91ba3"/>
                </reportElement>
                <textElement>
                    <font size="12"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{serie_conhecimento}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="142" y="0" width="140" height="51" uuid="092b57e7-2f7c-4686-8462-347c62839e8d">
                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="eb31812e-f740-4b5a-b134-42877ad91ba3"/>
                </reportElement>
                <textElement>
                    <font size="12"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{numero_conhecimento}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="282" y="0" width="140" height="51" uuid="381c9f77-6a2e-4549-9dc2-5d14d9948210">
                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="eb31812e-f740-4b5a-b134-42877ad91ba3"/>
                </reportElement>
                <textElement>
                    <font size="12"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{data_emissao_conhecimento}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="562" y="0" width="140" height="51" uuid="4bd6547a-72e2-4ee8-94ed-7d3104b9e818">
                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="eb31812e-f740-4b5a-b134-42877ad91ba3"/>
                </reportElement>
                <textElement>
                    <font size="12"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{valor_frete}]]></textFieldExpression>
            </textField>
        </band>
    </detail>
    <summary>
        <band height="42" splitType="Stretch"/>
    </summary>
</jasperReport>

The page looks like this,.inserir a descrição da imagem aqui

1 answer

1

Ola Voce needs to mark the position of the subreport below as flow, so that it can float freely without being over the first subreport

Browser other questions tagged

You are not signed in. Login or sign up in order to post.