2
votes

Trying to create a jasper report, I can see the data when I export to xls or csv. But column header is missing, not sure whats wrong with it, following is my report. Thanks in Advance.

<?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="scireport" language="groovy" printOrder="Horizontal" pageWidth="5000" pageHeight="792" whenNoDataType="AllSectionsNoDetail" columnWidth="4960" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" isIgnorePagination="true">
    <property name="ireport.zoom" value="1.0"/>
    <property name="ireport.x" value="0"/>
    <property name="ireport.y" value="0"/>
    <queryString language="SQL">
        <![CDATA[select PICKUP_DATE from SCI_PLDDATA_VIEW order by EVENT_TIMESTAMP DESC]]>
    </queryString>
    <field name="PICKUP_DATE" class="java.sql.Timestamp">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <group name="stopid">
        <groupHeader>
            <band height="50"/>
        </groupHeader>
    </group>
    <columnHeader>
        <band height="44" splitType="Stretch">
            <textField>
                <reportElement x="0" y="0" width="900" height="20"/>
                <textElement>
                    <font size="14" isBold="true"/>
                </textElement>
                <textFieldExpression class="java.lang.String"><![CDATA[$R{jasper.PICKUP_DATE}]]></textFieldExpression>
            </textField>
        </band>
    </columnHeader>
    <detail>
        <band height="34" splitType="Stretch">
            <textField isStretchWithOverflow="true" pattern="MM-dd-yyyy HH:mm" isBlankWhenNull="true">
                <reportElement x="0" y="0" width="900" height="20"/>
                <textElement/>
                <textFieldExpression class="java.sql.Timestamp"><![CDATA[$F{PICKUP_DATE}]]></textFieldExpression>
            </textField>
        </band>
    </detail>
</jasperReport>
1
Can you provide your database?user1791574
@user1791574 using oracleuser1609085
It looks like fine. I have run it with my data. I dont get any issue.user1791574
Than you for your time! I might have missed any configuration regarding the jasper reports.user1609085
$R{jasper.PICKUP_DATE} , what you want describe using this. I do not use "R" datatype before in iReport.user1791574

1 Answers

3
votes

You are fetching data from database , your value will come in field. You should use $F{} instead of $R{} in column header.