1. java
  2. android
  3. c#
  4. .net
  5. javascript
  6. php
  7. jquery
  8. html
  9. sql

Quando vou gerar um relatorio via Jasper eIreport ele vem com a hora zerada na data. EX: 04/08/1991 00:00

Alguem sabe o porque que esta acontecendo isto?

Segue

<?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="RelatorioOSClientes" pageWidth="595" pageHeight="842" columnWidth="535" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
    <queryString language="SQL">
        <![CDATA[SELECT
     clientes."nome" AS clientes_nome,
     servicos."descricao" AS servicos_descricao,
     servicos."data" AS servicos_data,
     servicos."valor" AS servicos_valor
FROM
     "public"."clientes" clientes INNER JOIN "public"."servicos" servicos ON clientes."idcliente" = servicos."idcliente"
WHERE
     clientes.idcliente=servicos.idcliente;]]>
    </queryString>
    <field name="clientes_nome" class="java.lang.String">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="servicos_descricao" class="java.lang.String">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="servicos_data" class="java.sql.Date">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="servicos_valor" class="java.math.BigDecimal">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <background>
        <band/>
    </background>
    <title>
        <band height="83">
            <line>
                <reportElement x="0" y="8" width="555" height="1"/>
            </line>
            <line>
                <reportElement positionType="FixRelativeToBottom" x="0" y="51" width="555" height="1"/>
            </line>
            <staticText>
                <reportElement x="33" y="16" width="496" height="35"/>
                <textElement textAlignment="Center">
                    <font size="26" isBold="true"/>
                </textElement>
                <text><![CDATA[Relatório Geral de Ordens de Serviço]]></text>
            </staticText>
        </band>
    </title>
    <pageHeader>
        <band/>
    </pageHeader>
    <columnHeader>
        <band height="18">
            <staticText>
                <reportElement mode="Opaque" x="0" y="0" width="138" height="18" forecolor="#FFFFFF" backcolor="#999999"/>
                <textElement textAlignment="Center">
                    <font size="12"/>
                </textElement>
                <text><![CDATA[ Cliente]]></text>
            </staticText>
            <staticText>
                <reportElement mode="Opaque" x="138" y="0" width="204" height="18" forecolor="#FFFFFF" backcolor="#999999"/>
                <textElement textAlignment="Center">
                    <font size="12"/>
                </textElement>
                <text><![CDATA[Serviço prestado]]></text>
            </staticText>
            <staticText>
                <reportElement mode="Opaque" x="342" y="0" width="115" height="18" forecolor="#FFFFFF" backcolor="#999999"/>
                <textElement textAlignment="Center">
                    <font size="12"/>
                </textElement>
                <text><![CDATA[Data]]></text>
            </staticText>
            <staticText>
                <reportElement mode="Opaque" x="458" y="0" width="94" height="18" forecolor="#FFFFFF" backcolor="#999999"/>
                <textElement textAlignment="Center">
                    <font size="12"/>
                </textElement>
                <text><![CDATA[Valor]]></text>
            </staticText>
        </band>
    </columnHeader>
    <detail>
        <band height="20">
            <textField>
                <reportElement x="0" y="0" width="138" height="20"/>
                <textElement textAlignment="Center">
                    <font size="12"/>
                </textElement>
                <textFieldExpression class="java.lang.String"><![CDATA[$F{clientes_nome}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="138" y="0" width="204" height="20"/>
                <textElement textAlignment="Center">
                    <font size="12"/>
                </textElement>
                <textFieldExpression class="java.lang.String"><![CDATA[$F{servicos_descricao}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="343" y="0" width="115" height="20"/>
                <textElement textAlignment="Center">
                    <font size="12"/>
                </textElement>
                <textFieldExpression class="java.util.Date"><![CDATA[$F{servicos_data}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="458" y="0" width="94" height="20"/>
                <textElement textAlignment="Center">
                    <font size="12"/>
                </textElement>
                <textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{servicos_valor}]]></textFieldExpression>
            </textField>
        </band>
    </detail>
    <columnFooter>
        <band/>
    </columnFooter>
    <pageFooter>
        <band height="26">
            <textField evaluationTime="Report" pattern="" isBlankWhenNull="false">
                <reportElement key="textField" x="512" y="6" width="36" height="19" forecolor="#000000" backcolor="#FFFFFF"/>
                <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>
                <textElement>
                    <font size="10"/>
                </textElement>
                <textFieldExpression class="java.lang.String"><![CDATA["" + $V{PAGE_NUMBER}]]></textFieldExpression>
            </textField>
            <textField pattern="" isBlankWhenNull="false">
                <reportElement key="textField" x="342" y="6" width="170" height="19" forecolor="#000000" backcolor="#FFFFFF"/>
                <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>
                <textElement textAlignment="Right">
                    <font size="10"/>
                </textElement>
                <textFieldExpression class="java.lang.String"><![CDATA["Página " + $V{PAGE_NUMBER} + " de "]]></textFieldExpression>
            </textField>
            <textField pattern="" isBlankWhenNull="false">
                <reportElement key="textField" x="1" y="6" width="209" height="19" forecolor="#000000" backcolor="#FFFFFF"/>
                <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>
                <textElement>
                    <font size="10"/>
                </textElement>
                <textFieldExpression class="java.util.Date"><![CDATA[new Date()]]></textFieldExpression>
            </textField>
        </band>
    </pageFooter>
    <summary>
        <band/>
    </summary>
</jasperReport>
  • Provavelmente porque você não está salvando a hora no banco.

    rof20004   18 de mar de 2014
  • Coloca o código para ver como está pegando essas informações.

    Cruz   18 de mar de 2014
  • esta ai, acho que era isso ne? Obrigado pela resposta de vcs

    Willian Lorenson   18 de mar de 2014
  • Verifique primeiro se você esta salvando a data/hora corretamente.

    rof20004   18 de mar de 2014
  • acredito que esteja, pq senao nem sairia a data no relatorio.. nao acha?

    Willian Lorenson   18 de mar de 2014
Mostrar todos os 6 comentários>
  1. Você vai ver essas setas em qualquer página de pergunta. Com elas, você pode dizer se uma pergunta ou uma resposta foram relevantes ou não.
  2. Edite sua pergunta ou resposta caso queira alterar ou adicionar detalhes.
  3. Caso haja alguma dúvida sobre a pergunta, adicione um comentário. O espaço de respostas deve ser utilizado apenas para responder a pergunta.
  4. Se o autor da pergunta marcar uma resposta como solucionada, esta marca aparecerá.
  5. Clique aqui para mais detalhes sobre o funcionamento do GUJ!

2 respostas

Não é a resposta que estava procurando? Procure outras perguntas com as tags java ireport jasperreports ou faça a sua própria pergunta.