Ir para conteúdo

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

gui_nastrini

Summary do iReport não traz os fields

Recommended Posts

No sistema gerencial que estou trabalhando, gero em PDF um comprovante não fiscal para impressora térmica feito no iReport utilizando a biblioteca PHPJasperXML.
Neste comprovante, quando se tem apenas um produto na aba Detail, não aparecem os fields do Summary. No preview do iReport funciona perfeitamente. E quando se tem dois produtos ou mais, também funciona certinho.

 

Segue o jrxml do relatório:

 

<?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="Comprovante de Venda" language="groovy" pageWidth="226" pageHeight="1000" columnWidth="186" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="7adaf37b-383e-4716-8dba-c60672258fa5">
    <property name="ireport.zoom" value="2.0"/>
    <property name="ireport.x" value="0"/>
    <property name="ireport.y" value="0"/>
    <queryString>
        <![CDATA[SELECT v.nrvenda AS nrvenda, v.data AS data, v.total_prod AS total_prod, v.desconto AS desconto, v.total_venda AS total_venda, v.total_rec AS total_rec, v.troco AS troco, v.endereco_e AS endereco, v.numero_e AS numero, v.complemento_e AS complemento, v.bairro_e AS bairro, v.cidade_e AS cidade, v.uf_e AS uf, i.quantidade AS quantidade, i.valor AS valor, ((i.valor * i.quantidade) - i.desconto) AS subtotal, ve.nomev AS nomev, c.nome AS nome, i.descricao AS descricao, pa.foto1 AS foto1, pa.fantasia AS fantasia, f.hoje AS hoje, f.pagamentos_venda AS pagamentos_venda FROM vendas v, ivendas i, produtos p, vendedor ve, clientes c, parametros pa, filtro_relats f WHERE v.vendas_id = f.consulta AND v.vendas_id = i.venda_id AND v.cliente = c.id AND v.vendedor = ve.id AND i.cod_prod = p.id_produto]]>
    </queryString>
    <field name="nrvenda" class="java.lang.Integer">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="data" class="java.sql.Date">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="total_prod" class="java.math.BigDecimal">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="desconto" class="java.math.BigDecimal">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="total_venda" class="java.math.BigDecimal">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="total_rec" class="java.math.BigDecimal">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="troco" class="java.math.BigDecimal">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="endereco" class="java.lang.String"/>
    <field name="numero" class="java.lang.Integer"/>
    <field name="complemento" class="java.lang.String"/>
    <field name="bairro" class="java.lang.String"/>
    <field name="cidade" class="java.lang.String"/>
    <field name="uf" class="java.lang.String"/>
    <field name="quantidade" class="java.math.BigDecimal">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="valor" class="java.math.BigDecimal">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="subtotal" class="java.math.BigDecimal"/>
    <field name="nomev" class="java.lang.String">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="nome" class="java.lang.String">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="descricao" class="java.lang.String">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="foto1" class="java.lang.String">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="fantasia" class="java.lang.String">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="hoje" class="java.lang.String">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="pagamentos_venda" class="java.lang.String">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <title>
        <band height="187">
            <textField pattern="dd/MM/yyyy">
                <reportElement x="120" y="99" width="66" height="12" uuid="25d34e22-9598-4071-a564-30baf0f8d047"/>
                <box>
                    <pen lineWidth="0.25" lineColor="#999999"/>
                    <topPen lineWidth="0.25" lineColor="#999999"/>
                    <leftPen lineWidth="0.25" lineColor="#999999"/>
                    <bottomPen lineWidth="0.25" lineColor="#999999"/>
                    <rightPen lineWidth="0.25" lineColor="#999999"/>
                </box>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font size="7"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{data}]]></textFieldExpression>
            </textField>
            <staticText>
                <reportElement mode="Opaque" x="0" y="99" width="55" height="12" backcolor="#CCCCCC" uuid="8b7388ce-c123-462b-bea7-0f93b3ddfb68"/>
                <box>
                    <pen lineWidth="0.25" lineColor="#999999"/>
                    <topPen lineWidth="0.25" lineColor="#999999"/>
                    <leftPen lineWidth="0.25" lineColor="#999999"/>
                    <bottomPen lineWidth="0.25" lineColor="#999999"/>
                    <rightPen lineWidth="0.25" lineColor="#999999"/>
                </box>
                <textElement verticalAlignment="Middle">
                    <font size="7" isBold="true"/>
                    <paragraph leftIndent="5"/>
                </textElement>
                <text><![CDATA[Nº DA VENDA:]]></text>
            </staticText>
            <textField>
                <reportElement x="55" y="99" width="55" height="12" uuid="193a1c6b-9e51-4778-9c01-4bd35f7ba684"/>
                <box>
                    <pen lineWidth="0.25" lineColor="#999999"/>
                    <topPen lineWidth="0.25" lineColor="#999999"/>
                    <leftPen lineWidth="0.25" lineColor="#999999"/>
                    <bottomPen lineWidth="0.25" lineColor="#999999"/>
                    <rightPen lineWidth="0.25" lineColor="#999999"/>
                </box>
                <textElement verticalAlignment="Middle">
                    <font size="7"/>
                    <paragraph leftIndent="5"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{nrvenda}]]></textFieldExpression>
            </textField>
            <line>
                <reportElement x="0" y="94" width="186" height="1" uuid="9ab7fd9c-500f-4eb2-bccf-4cdab7d7c03e"/>
            </line>
            <image>
                <reportElement x="0" y="0" width="186" height="56" uuid="ffabf6c5-f0b7-45c8-a208-0b33a2fafc9a"/>
                <imageExpression><![CDATA["../logo/"+$F{foto1}]]></imageExpression>
            </image>
            <staticText>
                <reportElement mode="Opaque" x="0" y="78" width="186" height="14" backcolor="#CCCCCC" uuid="676f6ab7-2ab4-4c6e-b9bb-672c6df618ea"/>
                <box>
                    <pen lineWidth="0.25" lineColor="#999999"/>
                    <topPen lineWidth="0.25" lineColor="#999999"/>
                    <leftPen lineWidth="0.25" lineColor="#999999"/>
                    <bottomPen lineWidth="0.25" lineColor="#999999"/>
                    <rightPen lineWidth="0.25" lineColor="#999999"/>
                </box>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font size="8" isBold="true"/>
                    <paragraph leftIndent="5"/>
                </textElement>
                <text><![CDATA[COMPROVANTE NÃO FISCAL]]></text>
            </staticText>
            <line>
                <reportElement x="0" y="185" width="186" height="1" uuid="7a7509a4-2e82-4170-997c-13a6a44b9177"/>
            </line>
            <textField>
                <reportElement mode="Opaque" x="0" y="58" width="186" height="18" backcolor="#CCCCCC" uuid="448ff1c2-ec6a-444b-a30a-ba5e25f1692e"/>
                <box>
                    <pen lineWidth="0.25" lineColor="#999999"/>
                    <topPen lineWidth="0.25" lineColor="#999999"/>
                    <leftPen lineWidth="0.25" lineColor="#999999"/>
                    <bottomPen lineWidth="0.25" lineColor="#999999"/>
                    <rightPen lineWidth="0.25" lineColor="#999999"/>
                </box>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font size="9" isBold="true"/>
                    <paragraph leftIndent="5"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{fantasia}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="55" y="111" width="131" height="12" uuid="7bf29b10-6585-45cd-b169-2e870129ca2d"/>
                <box>
                    <pen lineWidth="0.25" lineColor="#999999"/>
                    <topPen lineWidth="0.25" lineColor="#999999"/>
                    <leftPen lineWidth="0.25" lineColor="#999999"/>
                    <bottomPen lineWidth="0.25" lineColor="#999999"/>
                    <rightPen lineWidth="0.25" lineColor="#999999"/>
                </box>
                <textElement verticalAlignment="Middle">
                    <font size="7"/>
                    <paragraph leftIndent="5"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{nomev}]]></textFieldExpression>
            </textField>
            <staticText>
                <reportElement mode="Opaque" x="0" y="123" width="55" height="12" backcolor="#CCCCCC" uuid="9b9ba722-7986-4b75-861b-35585fbd440e"/>
                <box>
                    <pen lineWidth="0.25" lineColor="#999999"/>
                    <topPen lineWidth="0.25" lineColor="#999999"/>
                    <leftPen lineWidth="0.25" lineColor="#999999"/>
                    <bottomPen lineWidth="0.25" lineColor="#999999"/>
                    <rightPen lineWidth="0.25" lineColor="#999999"/>
                </box>
                <textElement verticalAlignment="Middle">
                    <font size="7" isBold="true"/>
                    <paragraph leftIndent="5"/>
                </textElement>
                <text><![CDATA[CLIENTE:]]></text>
            </staticText>
            <textField>
                <reportElement x="55" y="123" width="131" height="12" uuid="95771752-df56-4745-b53e-09d07bc97efb"/>
                <box>
                    <pen lineWidth="0.25" lineColor="#999999"/>
                    <topPen lineWidth="0.25" lineColor="#999999"/>
                    <leftPen lineWidth="0.25" lineColor="#999999"/>
                    <bottomPen lineWidth="0.25" lineColor="#999999"/>
                    <rightPen lineWidth="0.25" lineColor="#999999"/>
                </box>
                <textElement verticalAlignment="Middle">
                    <font size="7"/>
                    <paragraph leftIndent="5"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{nome}]]></textFieldExpression>
            </textField>
            <staticText>
                <reportElement mode="Opaque" x="0" y="111" width="55" height="12" backcolor="#CCCCCC" uuid="f425caaa-484f-45a4-aa51-66f1bb3693cb"/>
                <box>
                    <pen lineWidth="0.25" lineColor="#999999"/>
                    <topPen lineWidth="0.25" lineColor="#999999"/>
                    <leftPen lineWidth="0.25" lineColor="#999999"/>
                    <bottomPen lineWidth="0.25" lineColor="#999999"/>
                    <rightPen lineWidth="0.25" lineColor="#999999"/>
                </box>
                <textElement verticalAlignment="Middle">
                    <font size="7" isBold="true"/>
                    <paragraph leftIndent="5"/>
                </textElement>
                <text><![CDATA[VENDEDOR:]]></text>
            </staticText>
            <staticText>
                <reportElement mode="Opaque" x="0" y="135" width="55" height="12" backcolor="#CCCCCC" uuid="cc70adb1-3158-4cb3-92b5-f4c90449bf1c"/>
                <box>
                    <pen lineWidth="0.25" lineColor="#999999"/>
                    <topPen lineWidth="0.25" lineColor="#999999"/>
                    <leftPen lineWidth="0.25" lineColor="#999999"/>
                    <bottomPen lineWidth="0.25" lineColor="#999999"/>
                    <rightPen lineWidth="0.25" lineColor="#999999"/>
                </box>
                <textElement verticalAlignment="Middle">
                    <font size="7" isBold="true"/>
                    <paragraph leftIndent="5"/>
                </textElement>
                <text><![CDATA[ENDEREÇO:]]></text>
            </staticText>
            <textField>
                <reportElement x="55" y="135" width="131" height="12" uuid="fd98d079-e937-498d-93c9-512bc4d2f70d"/>
                <box>
                    <pen lineWidth="0.25" lineColor="#999999"/>
                    <topPen lineWidth="0.25" lineColor="#999999"/>
                    <leftPen lineWidth="0.25" lineColor="#999999"/>
                    <bottomPen lineWidth="0.25" lineColor="#999999"/>
                    <rightPen lineWidth="0.25" lineColor="#999999"/>
                </box>
                <textElement verticalAlignment="Middle">
                    <font size="7"/>
                    <paragraph leftIndent="5"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{endereco} + ', ' + $F{numero}]]></textFieldExpression>
            </textField>
            <staticText>
                <reportElement mode="Opaque" x="0" y="147" width="55" height="12" backcolor="#CCCCCC" uuid="faef5472-b6b5-4219-965e-cf5c8279d25b"/>
                <box>
                    <pen lineWidth="0.25" lineColor="#999999"/>
                    <topPen lineWidth="0.25" lineColor="#999999"/>
                    <leftPen lineWidth="0.25" lineColor="#999999"/>
                    <bottomPen lineWidth="0.25" lineColor="#999999"/>
                    <rightPen lineWidth="0.25" lineColor="#999999"/>
                </box>
                <textElement verticalAlignment="Middle">
                    <font size="7" isBold="true"/>
                    <paragraph leftIndent="5"/>
                </textElement>
                <text><![CDATA[COMP.:]]></text>
            </staticText>
            <textField>
                <reportElement x="55" y="147" width="131" height="12" uuid="1acd940f-3f5f-44c6-8009-8c37fb41fdea"/>
                <box>
                    <pen lineWidth="0.25" lineColor="#999999"/>
                    <topPen lineWidth="0.25" lineColor="#999999"/>
                    <leftPen lineWidth="0.25" lineColor="#999999"/>
                    <bottomPen lineWidth="0.25" lineColor="#999999"/>
                    <rightPen lineWidth="0.25" lineColor="#999999"/>
                </box>
                <textElement verticalAlignment="Middle">
                    <font size="7"/>
                    <paragraph leftIndent="5"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{complemento}]]></textFieldExpression>
            </textField>
            <staticText>
                <reportElement mode="Opaque" x="0" y="159" width="55" height="12" backcolor="#CCCCCC" uuid="983a2a9a-df4d-4bc5-a2f8-236b28c128f8"/>
                <box>
                    <pen lineWidth="0.25" lineColor="#999999"/>
                    <topPen lineWidth="0.25" lineColor="#999999"/>
                    <leftPen lineWidth="0.25" lineColor="#999999"/>
                    <bottomPen lineWidth="0.25" lineColor="#999999"/>
                    <rightPen lineWidth="0.25" lineColor="#999999"/>
                </box>
                <textElement verticalAlignment="Middle">
                    <font size="7" isBold="true"/>
                    <paragraph leftIndent="5"/>
                </textElement>
                <text><![CDATA[BAIRRO:]]></text>
            </staticText>
            <textField>
                <reportElement x="55" y="159" width="131" height="12" uuid="dcc222e1-a8a8-4a37-af69-692f3e482259"/>
                <box>
                    <pen lineWidth="0.25" lineColor="#999999"/>
                    <topPen lineWidth="0.25" lineColor="#999999"/>
                    <leftPen lineWidth="0.25" lineColor="#999999"/>
                    <bottomPen lineWidth="0.25" lineColor="#999999"/>
                    <rightPen lineWidth="0.25" lineColor="#999999"/>
                </box>
                <textElement verticalAlignment="Middle">
                    <font size="7"/>
                    <paragraph leftIndent="5"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{bairro}]]></textFieldExpression>
            </textField>
            <staticText>
                <reportElement mode="Opaque" x="0" y="171" width="55" height="12" backcolor="#CCCCCC" uuid="48652fef-989f-41d7-a84d-d63153eeba24"/>
                <box>
                    <pen lineWidth="0.25" lineColor="#999999"/>
                    <topPen lineWidth="0.25" lineColor="#999999"/>
                    <leftPen lineWidth="0.25" lineColor="#999999"/>
                    <bottomPen lineWidth="0.25" lineColor="#999999"/>
                    <rightPen lineWidth="0.25" lineColor="#999999"/>
                </box>
                <textElement verticalAlignment="Middle">
                    <font size="7" isBold="true"/>
                    <paragraph leftIndent="5"/>
                </textElement>
                <text><![CDATA[CIDADE:]]></text>
            </staticText>
            <textField>
                <reportElement x="55" y="171" width="131" height="12" uuid="85297550-2f69-4120-93e9-30ef295af055"/>
                <box>
                    <pen lineWidth="0.25" lineColor="#999999"/>
                    <topPen lineWidth="0.25" lineColor="#999999"/>
                    <leftPen lineWidth="0.25" lineColor="#999999"/>
                    <bottomPen lineWidth="0.25" lineColor="#999999"/>
                    <rightPen lineWidth="0.25" lineColor="#999999"/>
                </box>
                <textElement verticalAlignment="Middle">
                    <font size="7"/>
                    <paragraph leftIndent="5"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{cidade} + ' / ' + $F{uf}]]></textFieldExpression>
            </textField>
        </band>
    </title>
    <columnHeader>
        <band height="12">
            <staticText>
                <reportElement mode="Opaque" x="52" y="0" width="67" height="12" backcolor="#CCCCCC" uuid="f48675f7-1e42-45ac-a180-6002eeb777cc"/>
                <box>
                    <pen lineWidth="0.25" lineColor="#999999"/>
                    <topPen lineWidth="0.25" lineColor="#999999"/>
                    <leftPen lineWidth="0.25" lineColor="#999999"/>
                    <bottomPen lineWidth="0.25" lineColor="#999999"/>
                    <rightPen lineWidth="0.25" lineColor="#999999"/>
                </box>
                <textElement textAlignment="Center" verticalAlignment="Top">
                    <font size="7" isBold="true"/>
                    <paragraph rightIndent="5"/>
                </textElement>
                <text><![CDATA[R$ VALOR]]></text>
            </staticText>
            <staticText>
                <reportElement mode="Opaque" x="0" y="0" width="52" height="12" backcolor="#CCCCCC" uuid="74c403aa-4d3e-4c21-a274-5c6e7eeb9745"/>
                <box>
                    <pen lineWidth="0.25" lineColor="#999999"/>
                    <topPen lineWidth="0.25" lineColor="#999999"/>
                    <leftPen lineWidth="0.25" lineColor="#999999"/>
                    <bottomPen lineWidth="0.25" lineColor="#999999"/>
                    <rightPen lineWidth="0.25" lineColor="#999999"/>
                </box>
                <textElement textAlignment="Center" verticalAlignment="Top">
                    <font size="7" isBold="true"/>
                    <paragraph rightIndent="5"/>
                </textElement>
                <text><![CDATA[QUANTIDADE]]></text>
            </staticText>
            <staticText>
                <reportElement mode="Opaque" x="119" y="0" width="67" height="12" backcolor="#CCCCCC" uuid="3482c3c9-3373-479e-b458-d5327c3b4b09"/>
                <box>
                    <pen lineWidth="0.25" lineColor="#999999"/>
                    <topPen lineWidth="0.25" lineColor="#999999"/>
                    <leftPen lineWidth="0.25" lineColor="#999999"/>
                    <bottomPen lineWidth="0.25" lineColor="#999999"/>
                    <rightPen lineWidth="0.25" lineColor="#999999"/>
                </box>
                <textElement textAlignment="Center" verticalAlignment="Top">
                    <font size="7" isBold="true"/>
                    <paragraph rightIndent="5"/>
                </textElement>
                <text><![CDATA[R$ SUBTOTAL]]></text>
            </staticText>
        </band>
    </columnHeader>
    <detail>
        <band height="25" splitType="Stretch">
            <textField isStretchWithOverflow="true">
                <reportElement x="0" y="0" width="186" height="12" uuid="e06c4bc6-e0f7-4e0e-8a7b-ab5ce1fd5e62"/>
                <box>
                    <pen lineWidth="0.25" lineColor="#999999"/>
                    <topPen lineWidth="0.25" lineColor="#999999"/>
                    <leftPen lineWidth="0.25" lineColor="#999999"/>
                    <bottomPen lineWidth="0.25" lineColor="#999999"/>
                    <rightPen lineWidth="0.25" lineColor="#999999"/>
                </box>
                <textElement verticalAlignment="Middle">
                    <font size="7" isBold="false"/>
                    <paragraph leftIndent="5"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{descricao}]]></textFieldExpression>
            </textField>
            <textField pattern="#,##0.00;-#,##0.00">
                <reportElement x="53" y="12" width="67" height="12" uuid="1d928a34-4972-4204-9612-9f0e8a6749d3"/>
                <box>
                    <pen lineWidth="0.25" lineColor="#999999"/>
                    <topPen lineWidth="0.25" lineColor="#999999"/>
                    <leftPen lineWidth="0.25" lineColor="#999999"/>
                    <bottomPen lineWidth="0.25" lineColor="#999999"/>
                    <rightPen lineWidth="0.25" lineColor="#999999"/>
                </box>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font size="7"/>
                    <paragraph rightIndent="5"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{valor}]]></textFieldExpression>
            </textField>
            <textField pattern="#,##0.00;-#,##0.00">
                <reportElement x="0" y="12" width="52" height="12" uuid="f6d30d04-d0fe-4dd3-a675-377ff6d2b473"/>
                <box>
                    <pen lineWidth="0.25" lineColor="#999999"/>
                    <topPen lineWidth="0.25" lineColor="#999999"/>
                    <leftPen lineWidth="0.25" lineColor="#999999"/>
                    <bottomPen lineWidth="0.25" lineColor="#999999"/>
                    <rightPen lineWidth="0.25" lineColor="#999999"/>
                </box>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font size="7"/>
                    <paragraph rightIndent="5"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{quantidade}]]></textFieldExpression>
            </textField>
            <textField pattern="#,##0.00;-#,##0.00">
                <reportElement x="119" y="12" width="67" height="12" uuid="0603e3b7-801d-49af-9a06-5d33023c5277"/>
                <box>
                    <pen lineWidth="0.25" lineColor="#999999"/>
                    <topPen lineWidth="0.25" lineColor="#999999"/>
                    <leftPen lineWidth="0.25" lineColor="#999999"/>
                    <bottomPen lineWidth="0.25" lineColor="#999999"/>
                    <rightPen lineWidth="0.25" lineColor="#999999"/>
                </box>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font size="7"/>
                    <paragraph rightIndent="5"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{subtotal}]]></textFieldExpression>
            </textField>
        </band>
    </detail>
    <summary>
        <band height="203">
            <staticText>
                <reportElement mode="Opaque" x="0" y="82" width="85" height="16" backcolor="#CCCCCC" uuid="6b173bab-525a-4da5-a564-723a8cbb1fbc"/>
                <box>
                    <pen lineWidth="0.25" lineColor="#999999"/>
                    <topPen lineWidth="0.25" lineColor="#999999"/>
                    <leftPen lineWidth="0.25" lineColor="#999999"/>
                    <bottomPen lineWidth="0.25" lineColor="#999999"/>
                    <rightPen lineWidth="0.25" lineColor="#999999"/>
                </box>
                <textElement verticalAlignment="Middle">
                    <font size="7" isBold="true"/>
                    <paragraph leftIndent="5"/>
                </textElement>
                <text><![CDATA[R$ TROCO:]]></text>
            </staticText>
            <staticText>
                <reportElement x="0" y="3" width="53" height="12" uuid="c99a6844-ca28-47c7-a022-80d2717bf547"/>
                <textElement textAlignment="Center" verticalAlignment="Bottom">
                    <font size="7"/>
                    <paragraph leftIndent="5"/>
                </textElement>
                <text><![CDATA[Emissão:]]></text>
            </staticText>
            <staticText>
                <reportElement mode="Opaque" x="0" y="66" width="85" height="16" backcolor="#CCCCCC" uuid="d0b8947e-8183-4a55-8b6d-f238bdac0404"/>
                <box>
                    <pen lineWidth="0.25" lineColor="#999999"/>
                    <topPen lineWidth="0.25" lineColor="#999999"/>
                    <leftPen lineWidth="0.25" lineColor="#999999"/>
                    <bottomPen lineWidth="0.25" lineColor="#999999"/>
                    <rightPen lineWidth="0.25" lineColor="#999999"/>
                </box>
                <textElement verticalAlignment="Middle">
                    <font size="7" isBold="true"/>
                    <paragraph leftIndent="5"/>
                </textElement>
                <text><![CDATA[R$ TOTAL REC.:]]></text>
            </staticText>
            <textField pattern="#,##0.00;-#,##0.00">
                <reportElement isPrintRepeatedValues="false" x="85" y="82" width="101" height="16" uuid="a15e9cba-0f96-42be-8071-dbd7afecf73a"/>
                <box>
                    <pen lineWidth="0.25" lineColor="#999999"/>
                    <topPen lineWidth="0.25" lineColor="#999999"/>
                    <leftPen lineWidth="0.25" lineColor="#999999"/>
                    <bottomPen lineWidth="0.25" lineColor="#999999"/>
                    <rightPen lineWidth="0.25" lineColor="#999999"/>
                </box>
                <textElement textAlignment="Right" verticalAlignment="Middle">
                    <font size="7"/>
                    <paragraph rightIndent="5"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{troco}]]></textFieldExpression>
            </textField>
            <textField pattern="#,##0.00;-#,##0.00">
                <reportElement isPrintRepeatedValues="false" x="85" y="34" width="101" height="16" uuid="47411e66-b385-427c-825c-3be4e4abe45e"/>
                <box>
                    <pen lineWidth="0.25" lineColor="#999999"/>
                    <topPen lineWidth="0.25" lineColor="#999999"/>
                    <leftPen lineWidth="0.25" lineColor="#999999"/>
                    <bottomPen lineWidth="0.25" lineColor="#999999"/>
                    <rightPen lineWidth="0.25" lineColor="#999999"/>
                </box>
                <textElement textAlignment="Right" verticalAlignment="Middle">
                    <font size="7"/>
                    <paragraph rightIndent="5"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{desconto}]]></textFieldExpression>
            </textField>
            <staticText>
                <reportElement mode="Opaque" x="0" y="34" width="85" height="16" backcolor="#CCCCCC" uuid="05f791f7-9e38-4ee2-b7db-8e1ec1d6275f"/>
                <box>
                    <pen lineWidth="0.25" lineColor="#999999"/>
                    <topPen lineWidth="0.25" lineColor="#999999"/>
                    <leftPen lineWidth="0.25" lineColor="#999999"/>
                    <bottomPen lineWidth="0.25" lineColor="#999999"/>
                    <rightPen lineWidth="0.25" lineColor="#999999"/>
                </box>
                <textElement verticalAlignment="Middle">
                    <font size="7" isBold="true"/>
                    <paragraph leftIndent="5"/>
                </textElement>
                <text><![CDATA[R$ DESCONTO:]]></text>
            </staticText>
            <staticText>
                <reportElement mode="Opaque" x="0" y="18" width="85" height="16" backcolor="#CCCCCC" uuid="3c260ede-9083-41f2-aa35-b2e044fc645a"/>
                <box>
                    <pen lineWidth="0.25" lineColor="#999999"/>
                    <topPen lineWidth="0.25" lineColor="#999999"/>
                    <leftPen lineWidth="0.25" lineColor="#999999"/>
                    <bottomPen lineWidth="0.25" lineColor="#999999"/>
                    <rightPen lineWidth="0.25" lineColor="#999999"/>
                </box>
                <textElement verticalAlignment="Middle">
                    <font size="7" isBold="true"/>
                    <paragraph leftIndent="5"/>
                </textElement>
                <text><![CDATA[R$ SUBTOTAL:]]></text>
            </staticText>
            <textField>
                <reportElement x="53" y="3" width="133" height="12" uuid="47291c92-c9d1-40ac-a8d8-82247f26f98b"/>
                <textElement verticalAlignment="Top">
                    <font size="7"/>
                    <paragraph leftIndent="5"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{hoje}]]></textFieldExpression>
            </textField>
            <textField pattern="#,##0.00;-#,##0.00">
                <reportElement isPrintRepeatedValues="false" x="85" y="66" width="101" height="16" uuid="798cef8b-50c8-437b-af79-95526dbcd315"/>
                <box>
                    <pen lineWidth="0.25" lineColor="#999999"/>
                    <topPen lineWidth="0.25" lineColor="#999999"/>
                    <leftPen lineWidth="0.25" lineColor="#999999"/>
                    <bottomPen lineWidth="0.25" lineColor="#999999"/>
                    <rightPen lineWidth="0.25" lineColor="#999999"/>
                </box>
                <textElement textAlignment="Right" verticalAlignment="Middle">
                    <font size="7"/>
                    <paragraph rightIndent="5"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{total_rec}]]></textFieldExpression>
            </textField>
            <textField pattern="#,##0.00;-#,##0.00">
                <reportElement isPrintRepeatedValues="false" mode="Transparent" x="85" y="18" width="101" height="16" uuid="ac0e949b-93f4-4ded-a654-97230a33cb20"/>
                <box>
                    <pen lineWidth="0.25" lineColor="#999999"/>
                    <topPen lineWidth="0.25" lineColor="#999999"/>
                    <leftPen lineWidth="0.25" lineColor="#999999"/>
                    <bottomPen lineWidth="0.25" lineColor="#999999"/>
                    <rightPen lineWidth="0.25" lineColor="#999999"/>
                </box>
                <textElement textAlignment="Right" verticalAlignment="Middle">
                    <font size="7" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
                    <paragraph rightIndent="5"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{total_prod}]]></textFieldExpression>
            </textField>
            <textField pattern="#,##0.00;-#,##0.00">
                <reportElement isPrintRepeatedValues="false" x="85" y="50" width="101" height="16" uuid="98a37383-f178-4e9b-817a-66c3ebe183a5"/>
                <box>
                    <pen lineWidth="0.25" lineColor="#999999"/>
                    <topPen lineWidth="0.25" lineColor="#999999"/>
                    <leftPen lineWidth="0.25" lineColor="#999999"/>
                    <bottomPen lineWidth="0.25" lineColor="#999999"/>
                    <rightPen lineWidth="0.25" lineColor="#999999"/>
                </box>
                <textElement textAlignment="Right" verticalAlignment="Middle">
                    <font size="7"/>
                    <paragraph rightIndent="5"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{total_venda}]]></textFieldExpression>
            </textField>
            <textField isStretchWithOverflow="true">
                <reportElement positionType="Float" stretchType="RelativeToBandHeight" x="0" y="102" width="186" height="98" isPrintWhenDetailOverflows="true" uuid="85f18504-1690-48ae-a11a-02a6b0ef4489"/>
                <box>
                    <pen lineColor="#999999"/>
                    <topPen lineColor="#999999"/>
                    <leftPen lineColor="#999999"/>
                    <bottomPen lineColor="#999999"/>
                    <rightPen lineColor="#999999"/>
                </box>
                <textElement markup="none">
                    <font size="7" isPdfEmbedded="false"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{pagamentos_venda}]]></textFieldExpression>
            </textField>
            <staticText>
                <reportElement mode="Opaque" x="0" y="50" width="85" height="16" backcolor="#CCCCCC" uuid="1fc6ac4f-3090-4de5-8fd6-7562b4058ecf"/>
                <box>
                    <pen lineWidth="0.25" lineColor="#999999"/>
                    <topPen lineWidth="0.25" lineColor="#999999"/>
                    <leftPen lineWidth="0.25" lineColor="#999999"/>
                    <bottomPen lineWidth="0.25" lineColor="#999999"/>
                    <rightPen lineWidth="0.25" lineColor="#999999"/>
                </box>
                <textElement verticalAlignment="Middle">
                    <font size="7" isBold="true"/>
                    <paragraph leftIndent="5"/>
                </textElement>
                <text><![CDATA[R$ TOTAL:]]></text>
            </staticText>
            <line>
                <reportElement x="0" y="0" width="186" height="1" uuid="e3ab1d85-d813-4fe6-ba0d-70c9bf390b79"/>
            </line>
        </band>
    </summary>
</jasperReport>

É só o Summary que está com problema mesmo (da "emissão" pra baixo), o resto que não está aparecendo realmente foi omitido pois não cabe neste escopo.

Comprovante não fiscal com um produto.PNG

Comprovante não fiscal com dois produtos.PNG

Compartilhar este post


Link para o post
Compartilhar em outros sites

  • Conteúdo Similar

    • Por landerbadi
      Boa tarde pessoal. Estou tentado fazer uma consulta no banco de dados porém estou tendo dificuldades. Tenho uma tabela chamada "itens" com os seguintes campos: id, item, ativo. Nela tem cadastrado vários itens. No campo ativo eu coloco a letra "S" para informar que este item está ativo no sistema. Por exemplo: 1, casa, S 2, mesa, S 3, cama, S 4, moto S 5, rádio O quinto registro "radio" não está ativo no sistema pois não tem um "S" no campo ativo. E outra tabela chamada "produtos" com os seguintes campos (id, item1, item2, item3) com os seguintes registros: 1, casa, mesa, moto 2, mesa, casa, cama 3, rádio, cama, mesa Eu preciso fazer uma busca na tabela produtos da seguinte maneira: Eu escolho um registro na tabela "itens", por exemplo "mesa". Preciso fazer com que o php me liste todos os registros da tabela "produtos" que contenham a palavra "mesa". Até aqui tudo bem eu consigo listar. Estou fazendo assim: <?php $item = "mesa" $sql = mysqli_query($conn, "SELECT * FROM produtos WHERE item1 LIKE '$item' OR item2 LIKE '$item' OR item3 LIKE '$item' LIMIT 10"); while($aux = mysqli_fetch_assoc($sql)) { $id = $aux["id"]; $item1 = $aux["item1"]; $item2 = $aux["item2"]; $item3 = $aux["item3"]; echo $id . " - " . $item1 . ", " . $item2 . ", " $item3 . "<br>"; } ?> O problema é que está listando todos os registros que contém o item mesa. Eu preciso que o php verifique os demais item e me liste somente os registro em que todos os registros estejam ativos no sistema. No exemplo acima ele não deveria listar o registro 3. pois nesse registro contém o item "radio" e este item não está ativo no sistema. Ou seja, o registro "radio" na tabela itens não possui um "S" na coluna "ativo". Alguém sabe como resolver isso?
    • Por ILR master
      Fala galera.
      Espero que todos estejam bem.
      Seguinte: Tenho um arquivo xml onde alguns campos estão com : (dois pontos), como o exemplo abaixo:
       
      <item>
      <title>
      d sa dsad sad sadasdas
      </title>
      <link>
      dsadas dsa sad asd as dsada
      </link>
      <pubDate>sadasdasdsa as</pubDate>
      <dc:creator>
      d sad sad sa ad as das
      </dc:creator>
      </item>
       
      Meu código:
       
      $link = "noticias.xml"; 
      $xml = simplexml_load_file($link); 
      foreach($xml -> channel as $ite) {     
           $titulo = $ite -> item->title;
           $urltitulo = $ite -> item->link;
           print $urltitulo = $ite -> item->dc:creator;
      } //fim do foreach
      ?>
       
      Esse campo dc:creator eu não consigo ler. Como faço?
       
      Agradeço quem puder me ajudar.
       
      Abs
       
       
    • Por First
      Olá a todos!
       
      Eu estou criando um sistema do zero mas estou encontnrando algumas dificuldades e não estou sabendo resolver, então vim recorrer ajuda de vocês.
      Aqui está todo o meu código: https://github.com/PauloJagata/aprendizado/
       
      Eu fiz um sistema de rotas mas só mostra o conteúdo da '/' não sei porque, quando eu tento acessar o register nada muda.
      E eu também quero que se não estiver liberado na rota mostra o erro de 404, mas quando eu tento acessar um link inválido, nada acontece.
      Alguém pode me ajudar com isso? E se tiver algumas sugestão para melhoria do código também estou aceitando.
       
       
      Desde já, obrigado.
    • Por landerbadi
      Olá pessoal, boa tarde
       
      Tenho uma tabela chamada "produtos" com os seguintes campos (id, produto) e outra tabela chamada "itens" com os seguintes campos (id, prod_01, prod_02, prod_03, prod_04).
       
      Na tabela produtos eu tenho cadastrado os seguintes produtos: laranja, maçã, uva, goiaba, arroz, feijão, macarrão, etc.
       
      Na tabela itens eu tenho cadastrado os itens da seguinte maneira:
       
      1, laranja, uva, arroz, feijão;
      2, maçã, macarrão, goiaba, uva;
      3, arroz, feijão, maçã, azeite
       
      Meu problema é o seguinte: 
      Eu escolho um produto da tabela "produtos", por exemplo "uva".  Preciso fazer uma consulta na tabela "itens" para ser listado todos os registros que contenham o produto "uva" e que todos os demais produtos estejam cadastrados na tabela "produtos".
       
      No exemplo acima seria listado apenas dois registros, pois o terceiro registro não contém o produto "uva". 
       
      Alguém pode me ajudar? Pois estou quebrando a cabeça a vários dias e não consigo achar uma solução.
    • Por landerbadi
      Boa tarde pessoal. Estou tentado fazer uma consulta no banco de dados porém estou tendo dificuldades. Tenho uma tabela chamada "itens" com os seguintes campos: id, item, plural, ativo. Nela tem cadastrado vários itens e seu respectivo plural. No campo ativo eu coloco a letra "S" para informar que esta palavra está ativa no sistema. Por exemplo: 1, casa, casas, S 2, mesa, mesas, S 3, cama, camas, S 4, moto, motos, S 5, rádio, rádios O quinto registro "radio" não está ativo no sistema pois não tem um "S" no campo ativo. E outra tabela chamada "variações" com os seguintes campos (id, item1, item2, item3) com os seguintes registros: 1, casa, camas, moto 2, mesas, casas, radio 3, rádio, cama, mesa Eu preciso fazer uma busca na tabela variações da seguinte maneira: Eu escolho um registro na tabela "itens", por exemplo "casa". Preciso fazer com que o php me liste todos os registros da tabela "variações" que contenham a palavra "casa". Porém se tiver algum registro com a palavra "casas" também tem que ser listado. Neste caso ele irá encontrar dois registros. Agora eu preciso que o php verifique os demais itens e faça a listagem apenas dos item que estão ativos (que contenham um "S" no campo ativo. Neste caso ele irá encontrar apenas um registro, pois o segundo registro contém a palavra "rádio". E "rádio" não está ativo na tabela itens. Como faço isso?
×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.