在报告的第二页显示数据的问题

时间:2017-11-01 07:32:14

标签: charts jasper-reports

我正在尝试使用图表和数据创建一个jasper报告。但我无法在第二页显示数据。标题也无法正常显示。

我的报告包含以下元素/频段:

    1.页眉,显示徽标和来自日期字段
    2.列标题,其中包含图表/图表
    3.在详细信息区域中,使用自定义表格结构(使用文本字段创建)显示数据。
    4.最后有一个页脚。

请找到以下代码:

    <?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="peopleAvg" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="1bb591b9-6043-4a15-b759-36bd5afbc1c2">
        <property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
        <parameter name="fromDate" class="java.lang.String"/>
        <parameter name="toDate" class="java.lang.String"/>
        <parameter name="orgLogo" class="java.io.InputStream"/>
        <queryString>
                <![CDATA[]]>
        </queryString>
        <field name="slno" class="java.lang.String"/>
        <field name="hour" class="java.lang.String"/>
        <field name="insideProductivity" class="java.lang.Double"/>
        <field name="outsideProductivity" class="java.lang.Double"/>
        <field name="day" class="java.lang.Double"/>
        <field name="total" class="java.lang.Double"/>
        <pageHeader>
                <band height="66" splitType="Stretch">
                        <staticText>
                                <reportElement x="0" y="12" width="123" height="17" uuid="2ce05d01-f1ca-46ec-b055-6a786d6180a9"/>
                                <textElement>
                                        <font isBold="true"/>
                                </textElement>
                                <text><![CDATA[People Avg Productivity]]></text>
                        </staticText>
                        <staticText>
                                <reportElement x="0" y="42" width="52" height="21" uuid="1190e3e7-8e6e-4c07-a328-31ff29e54d3c"/>
                                <text><![CDATA[From Date:]]></text>
                        </staticText>
                        <textField>
                                <reportElement x="56" y="42" width="81" height="21" uuid="6dd52950-dbbb-48bd-8879-82cc00ad4f4c"/>
                                <textFieldExpression><![CDATA[$P{fromDate}]]></textFieldExpression>
                        </textField>
                        <staticText>
                                <reportElement x="138" y="42" width="47" height="21" uuid="ee86580c-820d-4116-94e5-eb5f745acf14"/>
                                <text><![CDATA[To Date:]]></text>
                        </staticText>
                        <textField>
                                <reportElement x="185" y="42" width="88" height="21" uuid="9d13a4d5-bddf-4bac-a44f-e24da7b38a0c"/>
                                <textFieldExpression><![CDATA[$P{toDate}]]></textFieldExpression>
                        </textField>
                        <image>
                                <reportElement x="480" y="0" width="70" height="59" uuid="a967b7a0-2bb3-41c9-a4a8-9597d26d4996"/>
                                <imageExpression><![CDATA[$P{orgLogo}]]></imageExpression>
                        </image>
                        <line>
                                <reportElement x="0" y="65" width="555" height="1" uuid="8af4ab23-161b-4419-ad6e-7056340a2023"/>
                        </line>
                </band>
        </pageHeader>
        <columnHeader>
                <band height="267" splitType="Stretch">
                        <stackedBar3DChart>
                                <chart evaluationTime="Report">
                                        <reportElement x="0" y="9" width="555" height="210" uuid="8ff37812-d1a7-49ae-b62c-f10cb1a69a02">
                                                <property name="com.jaspersoft.studio.unit.width" value="pixel"/>
                                        </reportElement>
                                        <chartTitle/>
                                        <chartSubtitle/>
                                        <chartLegend/>
                                </chart>
                                <categoryDataset>
                                        <categorySeries>
                                                <seriesExpression><![CDATA["Inside Mine"]]></seriesExpression>
                                                <categoryExpression><![CDATA[$F{hour}]]></categoryExpression>
                                                <valueExpression><![CDATA[$F{insideProductivity}]]></valueExpression>
                                                <labelExpression><![CDATA[$F{insideProductivity}+""]]></labelExpression>
                                        </categorySeries>
                                        <categorySeries>
                                                <seriesExpression><![CDATA["Outside Mine"]]></seriesExpression>
                                                <categoryExpression><![CDATA[$F{hour}]]></categoryExpression>
                                                <valueExpression><![CDATA[$F{outsideProductivity}]]></valueExpression>
                                                <labelExpression><![CDATA[$F{outsideProductivity}+""]]></labelExpression>
                                        </categorySeries>
                                </categoryDataset>
                                <bar3DPlot>
                                        <plot labelRotation="66.0"/>
                                        <itemLabel/>
                                        <categoryAxisFormat labelRotation="66.0">
                                                <axisFormat labelColor="#000000" tickLabelColor="#000000" axisLineColor="#000000"/>
                                        </categoryAxisFormat>
                                        <valueAxisFormat>
                                                <axisFormat labelColor="#000000" tickLabelColor="#000000" axisLineColor="#000000"/>
                                        </valueAxisFormat>
                                </bar3DPlot>
                        </stackedBar3DChart>
                        <staticText>
                                <reportElement x="97" y="228" width="58" height="30" uuid="dadece34-824f-481c-aa40-702eececcfa0"/>
                                <text><![CDATA[Time In Hrs]]></text>
                        </staticText>
                        <staticText>
                                <reportElement x="167" y="228" width="89" height="30" uuid="9f8ff91e-99d8-4fdd-98cb-4d6c09ac93f3"/>
                                <text><![CDATA[Mine In(Avg Time in Hrs)]]></text>
                        </staticText>
                        <staticText>
                                <reportElement x="267" y="228" width="100" height="30" uuid="fb564933-5603-440a-b4bb-9e7ffea3a60a"/>
                                <text><![CDATA[Mine Out(Avg Time In Hrs)]]></text>
                        </staticText>
                        <staticText>
                                <reportElement x="38" y="228" width="50" height="30" uuid="5c46f7d8-e33d-40ef-b266-be837cad3bf3"/>
                                <text><![CDATA[Sl.No]]></text>
                        </staticText>
                        <staticText>
                                <reportElement x="387" y="228" width="61" height="30" uuid="638b6be5-7679-45c9-a798-61e439710d14"/>
                                <text><![CDATA[Total Hours]]></text>
                        </staticText>
                        <staticText>
                                <reportElement x="137" y="187" width="73" height="30" uuid="94548637-903d-42b1-8be3-a59c9370fbf6"/>
                                <text><![CDATA[Time (in hrs)]]></text>
                        </staticText>
                        <staticText>
                                <reportElement x="2" y="60" width="18" height="65" uuid="01f4f72c-1f89-4dc9-a59f-bbc8e1523c0d"/>
                                <textElement rotation="Left"/>
                                <text><![CDATA[No of Hours]]></text>
                        </staticText>
                        <line>
                                <reportElement x="37" y="228" width="411" height="1" uuid="8097c975-2f0d-494e-a6b3-eac6c0049aea"/>
                        </line>
                        <line>
                                <reportElement x="38" y="227" width="1" height="38" uuid="967a9b95-64bc-4979-a11a-d12cb3204c27"/>
                        </line>
                        <line>
                                <reportElement x="448" y="227" width="1" height="39" uuid="22cfbc0d-5e9b-4853-a5c3-249210cbc611"/>
                        </line>
                        <line>
                                <reportElement x="88" y="226" width="1" height="39" uuid="d906ae7c-2395-4a03-9015-f38054af4239"/>
                        </line>
                        <line>
                                <reportElement x="162" y="228" width="1" height="37" uuid="2fcdb73a-f506-4425-8404-b12bbdf37759"/>
                        </line>
                        <line>
                                <reportElement x="263" y="228" width="1" height="37" uuid="a828608f-c02d-42d5-867b-6c4b41cc7ba3"/>
                        </line>
                        <line>
                                <reportElement x="380" y="227" width="1" height="39" uuid="a41cc5e7-d5ff-4ce1-aa45-110ce737febd"/>
                        </line>
                </band>
        </columnHeader>
        <detail>
                <band height="37" splitType="Stretch">
                        <textField pattern="" isBlankWhenNull="true">
                                <reportElement x="42" y="3" width="42" height="30" isPrintWhenDetailOverflows="true" uuid="4b14159d-88e2-403f-8d23-4348a9071edd"/>
                                <textFieldExpression><![CDATA[$F{slno}]]></textFieldExpression>
                        </textField>
                        <textField isBlankWhenNull="true">
                                <reportElement x="99" y="3" width="56" height="29" isPrintWhenDetailOverflows="true" uuid="c5f091cb-1dd4-42aa-b293-661fa30447d5"/>
                                <textElement textAlignment="Center"/>
                                <textFieldExpression><![CDATA[$F{hour}]]></textFieldExpression>
                        </textField>
                        <textField isBlankWhenNull="true">
                                <reportElement x="166" y="4" width="90" height="30" isPrintWhenDetailOverflows="true" uuid="3e402bb8-2c7d-44d2-88f7-bfd3923fa79b"/>
                                <textElement textAlignment="Center"/>
                                <textFieldExpression><![CDATA[$F{insideProductivity}]]></textFieldExpression>
                        </textField>
                        <textField isBlankWhenNull="true">
                                <reportElement x="266" y="5" width="100" height="30" isPrintWhenDetailOverflows="true" uuid="feb73c78-3f84-49ec-867b-aa4d0fa87aa6"/>
                                <textElement textAlignment="Center"/>
                                <textFieldExpression><![CDATA[$F{outsideProductivity}]]></textFieldExpression>
                        </textField>
                        <textField isBlankWhenNull="true">
                                <reportElement x="386" y="5" width="60" height="30" isPrintWhenDetailOverflows="true" uuid="20a6c8ca-ce41-4ba1-a877-b84ec62401bf"/>
                                <textElement textAlignment="Center"/>
                                <textFieldExpression><![CDATA[$F{total}]]></textFieldExpression>
                        </textField>
                        <line>
                                <reportElement x="38" y="-2" width="1" height="38" uuid="1dd9a050-2aee-4bf9-a05d-4191795c3b2c"/>
                        </line>
                        <line>
                                <reportElement x="88" y="-1" width="1" height="35" uuid="819297ed-658a-4e87-b2de-6de1c4ab0f9f"/>
                        </line>
                        <line>
                                <reportElement x="162" y="-1" width="1" height="35" uuid="683ef7c9-014a-4ece-8b8c-0f73238728fc"/>
                        </line>
                        <line>
                                <reportElement x="263" y="-3" width="1" height="40" uuid="1f47437f-6ee5-4281-aa7d-3d005ba8c3ba"/>
                        </line>
                        <line>
                                <reportElement x="380" y="0" width="1" height="37" uuid="c1d15bd7-3d55-4da6-8787-a6df37d0f892"/>
                        </line>
                        <line>
                                <reportElement x="448" y="-1" width="1" height="37" uuid="12959f57-ba8d-463f-9967-6c573a690dcf"/>
                        </line>
                        <line>
                                <reportElement x="39" y="35" width="410" height="1" uuid="5b39727f-2b4e-47d8-80c1-0b28afb08f72"/>
                        </line>
                </band>
        </detail>
        <pageFooter>
                <band height="54" splitType="Stretch"/>
        </pageFooter>   
</jasperReport>

请参阅下图。在底部,您会注意到打印的标题不完整,并且页面中没有更多数据

Please see the image below. At the bottom you will notice that the header printed is incomplete and also there is no more data in the page

有些人可以帮助我。

1 个答案:

答案 0 :(得分:0)

我可以解决这个问题。实际上我在这里使用的徽标存在问题。由于这个原因,它抛出了一个错误。我所做的只是改变了图像的几个属性,不得不重新运行报告。就这些。抱歉。谢谢你。