The pdf report with manual tagging throws EmptyStackException

0

I have spring webapp where I am using JasperReports to generate some basic database query reports and exporting into pdf.

I have tried programmatically adding tags instead of using jrxml, with dynamic-jasper and that runs into different issue. My jrxml file is almost a copy of tabular-report.jrxml example from Jaspersoft Studio. Let me know if you need to look at something else to figure this out, any help is appreciated at this point.

Found this but it has no solution: https://community.jaspersoft.com/questions/1112221/error-manulal-tagging...

Here is my jrxml file:

    <?xml version="1.0" encoding="UTF-8"?>
    <jasperReport ....>
        <style>....
        </style>
        <queryString>
            This works, deleted because its sensitive.
        </queryString>
        <field name="last_login" class="java.sql.Timestamp"/>
        <field name="first_name" class="java.lang.String"/>
        <field name="middle_name" class="java.lang.String"/>
        <field name="last_name" class="java.lang.String"/>
        <field name="IAL" class="java.lang.Integer"/>
        <field name="xid" class="java.lang.String"/>
        <field name="email" class="java.lang.String"/>
        <title>
            <band height="45">
                <staticText>
                    <reportElement style="reportTitleStyle" positionType="Float" x="0" y="0" width="595" height="30">
                        <property name="net.sf.jasperreports.export.pdf.tag.h1" value="full"/>
                    </reportElement>
                    <textElement/>
                    <text><![CDATA[User Login Report]]></text>
                </staticText>
                <textField>
                    <reportElement style="subTitleStyle" positionType="Float" x="0" y="30" width="595" height="15">
                        <property name="net.sf.jasperreports.export.pdf.tag.h2" value="full"/>
                    </reportElement>
                    <textElement/>
                    <textFieldExpression>
                        <![CDATA["This report was generated at " + new java.util.Date()]]></textFieldExpression>
                </textField>
            </band>
        </title>
        <pageHeader>
            <band height="30">
                <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                    <reportElement style="defaultHeaderStyle" positionType="Float" stretchType="RelativeToTallestObject" x="0" y="0" width="95" height="30" isPrintWhenDetailOverflows="true">
                        <property name="net.sf.jasperreports.export.pdf.tag.table" value="start"/>
                        <property name="net.sf.jasperreports.export.pdf.tag.th" value="full"/>
                        <property name="net.sf.jasperreports.export.pdf.tag.rowspan" value="2"/>
                    </reportElement>
                    <textElement/>
                    <textFieldExpression><![CDATA["Last Login"]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                    <reportElement style="defaultHeaderStyle" positionType="Float" stretchType="RelativeToTallestObject" x="95" y="0" width="83" height="30" isPrintWhenDetailOverflows="true">
                        <property name="net.sf.jasperreports.export.pdf.tag.th" value="full"/>
                        <property name="net.sf.jasperreports.export.pdf.tag.rowspan" value="2"/>
                    </reportElement>
                    <textElement/>
                    <textFieldExpression><![CDATA["First Name"]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                    <reportElement style="defaultHeaderStyle" positionType="Float" stretchType="RelativeToTallestObject" x="178" y="0" width="59" height="30" isPrintWhenDetailOverflows="true">
                        <property name="net.sf.jasperreports.export.pdf.tag.th" value="full"/>
                        <property name="net.sf.jasperreports.export.pdf.tag.rowspan" value="2"/>
                    </reportElement>
                    <textElement/>
                    <textFieldExpression><![CDATA["Middle Name"]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                    <reportElement style="defaultHeaderStyle" positionType="Float" stretchType="RelativeToTallestObject" x="237" y="0" width="83" height="30" isPrintWhenDetailOverflows="true">
                        <property name="net.sf.jasperreports.export.pdf.tag.th" value="full"/>
                        <property name="net.sf.jasperreports.export.pdf.tag.rowspan" value="2"/>
                    </reportElement>
                    <textElement/>
                    <textFieldExpression><![CDATA["Last Name"]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                    <reportElement style="defaultHeaderStyle" positionType="Float" stretchType="RelativeToTallestObject" x="320" y="0" width="35" height="30" isPrintWhenDetailOverflows="true">
                        <property name="net.sf.jasperreports.export.pdf.tag.th" value="full"/>
                        <property name="net.sf.jasperreports.export.pdf.tag.rowspan" value="2"/>
                    </reportElement>
                    <textElement/>
                    <textFieldExpression><![CDATA["IAL"]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                    <reportElement style="defaultHeaderStyle" positionType="Float" stretchType="RelativeToTallestObject" x="355" y="0" width="59" height="30" isPrintWhenDetailOverflows="true">
                        <property name="net.sf.jasperreports.export.pdf.tag.th" value="full"/>
                        <property name="net.sf.jasperreports.export.pdf.tag.rowspan" value="2"/>
                    </reportElement>
                    <textElement/>
                    <textFieldExpression><![CDATA["XID"]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                    <reportElement style="defaultHeaderStyle" positionType="Float" stretchType="RelativeToTallestObject" x="414" y="0" width="141" height="30" isPrintWhenDetailOverflows="true">
                        <property name="net.sf.jasperreports.export.pdf.tag.th" value="full"/>
                        <property name="net.sf.jasperreports.export.pdf.tag.rowspan" value="2"/>
                    </reportElement>
                    <textElement/>
                    <textFieldExpression><![CDATA["Email"]]></textFieldExpression>
                </textField>
            </band>
        </pageHeader>
        <detail>
            <band height="15" splitType="Immediate">
                <frame>
                    <reportElement x="0" y="0" width="555" height="15">
                        <property name="net.sf.jasperreports.export.pdf.tag.tr" value="full"/>
                    </reportElement>
                    <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                        <reportElement style="timeStampColumnStyle" positionType="Float" stretchType="RelativeToTallestObject" x="0" y="0" width="95" height="15" isPrintWhenDetailOverflows="true">
                            <property name="net.sf.jasperreports.export.pdf.tag.td" value="full"/>
                        </reportElement>
                        <textFieldExpression><![CDATA[$F{last_login}]]></textFieldExpression>
                    </textField>
                    <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                        <reportElement style="columnStyle" positionType="Float" stretchType="RelativeToTallestObject" x="95" y="0" width="83" height="15" isPrintWhenDetailOverflows="true">
                            <property name="net.sf.jasperreports.export.pdf.tag.td" value="full"/>
                        </reportElement>
                        <textFieldExpression><![CDATA[$F{first_name}]]></textFieldExpression>
                    </textField>
                    <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                        <reportElement style="columnStyle" positionType="Float" stretchType="RelativeToTallestObject" x="178" y="0" width="59" height="15" isPrintWhenDetailOverflows="true">
                            <property name="net.sf.jasperreports.export.pdf.tag.td" value="full"/>
                        </reportElement>
                        <textFieldExpression><![CDATA[$F{middle_name}]]></textFieldExpression>
                    </textField>
                    <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                        <reportElement style="columnStyle" positionType="Float" stretchType="RelativeToTallestObject" x="237" y="0" width="83" height="15" isPrintWhenDetailOverflows="true">
                            <property name="net.sf.jasperreports.export.pdf.tag.td" value="full"/>
                        </reportElement>
                        <textFieldExpression><![CDATA[$F{last_name}]]></textFieldExpression>
                    </textField>
                    <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                        <reportElement style="columnStyle" positionType="Float" stretchType="RelativeToTallestObject" x="320" y="0" width="35" height="15" isPrintWhenDetailOverflows="true">
                            <property name="net.sf.jasperreports.export.pdf.tag.td" value="full"/>
                        </reportElement>
                        <textFieldExpression><![CDATA[$F{IAL}]]></textFieldExpression>
                    </textField>
                    <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                        <reportElement style="columnStyle" positionType="Float" stretchType="RelativeToTallestObject" x="355" y="0" width="59" height="15" isPrintWhenDetailOverflows="true">
                            <property name="net.sf.jasperreports.export.pdf.tag.td" value="full"/>
                        </reportElement>
                        <textFieldExpression><![CDATA[$F{xid}]]></textFieldExpression>
                    </textField>
                    <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                        <reportElement style="columnStyle" positionType="Float" stretchType="RelativeToTallestObject" x="414" y="0" width="141" height="15" isPrintWhenDetailOverflows="true">
                            <property name="net.sf.jasperreports.export.pdf.tag.td" value="full"/>
                            <property name="net.sf.jasperreports.export.pdf.tag.table" value="end"/>
                        </reportElement>
                        <textElement textAlignment="Right"/>
                        <textFieldExpression><![CDATA[$F{email}]]></textFieldExpression>
                    </textField>
                </frame>
            </band>
        </detail>
    </jasperReport>


The error:

    java.util.EmptyStackException
    at java.util.Stack.peek(Stack.java:102)
    at net.sf.jasperreports.engine.export.JRPdfExporterTagHelper.createTrStartTag(JRPdfExporterTagHelper.java:664)
    at net.sf.jasperreports.engine.export.JRPdfExporterTagHelper.createStartTags(JRPdfExporterTagHelper.java:589)
    at net.sf.jasperreports.engine.export.JRPdfExporterTagHelper.startElement(JRPdfExporterTagHelper.java:499)
    at net.sf.jasperreports.engine.export.JRPdfExporter.exportElements(JRPdfExporter.java:1241)
    at net.sf.jasperreports.engine.export.JRPdfExporter.exportPage(JRPdfExporter.java:1210)
    at net.sf.jasperreports.engine.export.JRPdfExporter.exportReportToStream(JRPdfExporter.java:1074)
    at net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:691)
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)

sachintmakasana's picture
Joined: Aug 5 2020 - 8:22am
Last seen: 1 month 2 weeks ago

0 Answers:

No answers yet
Feedback
randomness