0

我试图在iReport中生成一个包含三个行组的报告,这会导致从数据库中检索到大量数据。我已经设置了足够的页面高度以在一张表格中以 Excel 和 HTML 格式获取所有数据,但生成的 PDF 格式是空白的。正在生成 5 个页面,但它们没有显示任何数据。当我将页面高度降低到四分之一时,会显示数据但没有更多的工作表报告。因此,我无法确定我的报告或某些显然需要修复的属性是否存在问题。

我的模板:

<?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="fte_summary_main_link" language="groovy" pageWidth="4000" pageHeight="40000" whenNoDataType="AllSectionsNoDetail" columnWidth="4000" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="b36dcea3-b438-417d-a4b4-77de45543aa9">
    <property name="setContentLength" value="outputStream_.toByteArray().length"/>
    <parameter name="p_deal_detail_id" class="java.lang.String">
        <defaultValueExpression><![CDATA[]]></defaultValueExpression>
    </parameter>
    <parameter name="p_tower_id" class="java.lang.String">
        <defaultValueExpression><![CDATA[]]></defaultValueExpression>
    </parameter>
    <parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">
        <defaultValueExpression><![CDATA["D:\\report_suchita\\FTE Summary\\"]]></defaultValueExpression>
    </parameter>
    <queryString>
        <![CDATA[select * from dual]]>
    </queryString>
    <field name="DUMMY" class="java.lang.String"/>
    <detail>
        <band height="40000">
            <subreport>
                <reportElement uuid="f9f5259a-e52a-445f-b00e-0b0f03696447" x="0" y="0" width="4000" height="10000"/>
                <subreportParameter name="deal_Detail_Id">
                    <subreportParameterExpression><![CDATA[$P{p_deal_detail_id}]]></subreportParameterExpression>
                </subreportParameter>
                <subreportParameter name="tower_Id">
                    <subreportParameterExpression><![CDATA[$P{p_tower_id}]]></subreportParameterExpression>
                </subreportParameter>
                <subreportParameter name="SUBREPORT_DIR">
                    <subreportParameterExpression><![CDATA[$P{SUBREPORT_DIR}]]></subreportParameterExpression>
                </subreportParameter>
                <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
                <subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "FTE_SUMMAR_SUBTOWER_WISE.jasper"]]></subreportExpression>
            </subreport>
        </band>
        <band height="40000">
            <subreport>
                <reportElement uuid="febf5345-b2f8-4afe-b5ed-db283ef7464c" x="0" y="0" width="4000" height="10000"/>
                <subreportParameter name="p_deal_detai_id">
                    <subreportParameterExpression><![CDATA[$P{p_deal_detail_id}]]></subreportParameterExpression>
                </subreportParameter>
                <subreportParameter name="p_tower_id">
                    <subreportParameterExpression><![CDATA[$P{p_tower_id}]]></subreportParameterExpression>
                </subreportParameter>
                <subreportParameter name="SUBREPORT_DIR">
                    <subreportParameterExpression><![CDATA[$P{SUBREPORT_DIR}]]></subreportParameterExpression>
                </subreportParameter>
                <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
                <subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "report6.jasper"]]></subreportExpression>
            </subreport>
        </band>
        <band height="40000">
            <subreport>
                <reportElement uuid="11cec18f-675a-4a39-94bc-3fb584ae5c2a" x="0" y="0" width="4000" height="10000"/>
                <subreportParameter name="dealDetailId">
                    <subreportParameterExpression><![CDATA[$P{p_deal_detail_id}]]></subreportParameterExpression>
                </subreportParameter>
                <subreportParameter name="towerId">
                    <subreportParameterExpression><![CDATA[$P{p_tower_id}]]></subreportParameterExpression>
                </subreportParameter>
                <subreportParameter name="SUBREPORT_DIR">
                    <subreportParameterExpression><![CDATA[$P{SUBREPORT_DIR}]]></subreportParameterExpression>
                </subreportParameter>
                <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
                <subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "FTE Summary GNDM view.jasper"]]></subreportExpression>
            </subreport>
        </band>
        <band height="40000">
            <subreport>
                <reportElement uuid="23cd3095-0210-49e0-8659-60d7b16b7b5e" x="0" y="0" width="4000" height="10000"/>
                <subreportParameter name="dealDetailId">
                    <subreportParameterExpression><![CDATA[$P{p_deal_detail_id}]]></subreportParameterExpression>
                </subreportParameter>
                <subreportParameter name="towerId">
                    <subreportParameterExpression><![CDATA[$P{p_tower_id}]]></subreportParameterExpression>
                </subreportParameter>
                <subreportParameter name="SUBREPORT_DIR">
                    <subreportParameterExpression><![CDATA[$P{SUBREPORT_DIR}]]></subreportParameterExpression>
                </subreportParameter>
                <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
                <subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "FTE Summary Subtower-Location Type-LocationWise Report.jasper"]]></subreportExpression>
            </subreport>
        </band>
    </detail>
    <summary>
        <band height="40000">
            <subreport>
                <reportElement uuid="01617f32-cc93-43ab-b155-c923a7cd0ae9" x="0" y="0" width="4000" height="10000"/>
                <subreportParameter name="towerId">
                    <subreportParameterExpression><![CDATA[$P{p_tower_id}]]></subreportParameterExpression>
                </subreportParameter>
                <subreportParameter name="dealDetailId">
                    <subreportParameterExpression><![CDATA[$P{p_deal_detail_id}]]></subreportParameterExpression>
                </subreportParameter>
                <subreportParameter name="SUBREPORT_DIR">
                    <subreportParameterExpression><![CDATA[$P{SUBREPORT_DIR}]]></subreportParameterExpression>
                </subreportParameter>
                <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
                <subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "FTE Summary-Location Type Location Type.jasper"]]></subreportExpression>
            </subreport>
        </band>
    </summary>
</jasperReport>
4

1 回答 1

0

您不需要将带高设置得非常高。您只需将带高设置为尽可能低,以添加特定领域的所有 pallate。此外,您只需为子报表设置 positionType 浮点数,您可以将其设置为任何大小,例如 15,20 等。您也可以在一个详细信息带中添加许多子报表。

<detail>
<band>
<subreport>
            <reportElement uuid="de20448b-1374-42bd-a65c-85e71a50d30d" positionType="Float" x="170" y="180" width="345" height="15"/>

            <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{ListName})]]></dataSourceExpression>
            <subreportExpression><![CDATA["path/to/subreport"]]></subreportExpression>
</subreport>
<subreport>
            <reportElement uuid="de20448b-1374-42bd-a65c-85e71a50d30d" positionType="Float" x="170" y="180" width="345" height="15"/>
            <subreportParameter name="imagePathInSubreport">
                <subreportParameterExpression><![CDATA[$P{imagePathInTemplate12}]]></subreportParameterExpression>
            </subreportParameter>
            <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{resumeList})]]></dataSourceExpression>
            <subreportExpression><![CDATA["/home/jft/workspace/CvSurgeon/CvSurgeon/web-app/report/template12/profile.jasper"]]></subreportExpression>
        </subreport>
</band>
</detail>

希望它会帮助你。

于 2013-08-21T13:58:57.843 回答