Jasper does not insert page break at the right place

0

Hello,

I want to add a blank page between each OLE documents. To do this, I use a report that contains two bands : the first band contains the OLE document (using a subreport) and the second contains page break and a little text.

My problem is that Jasper does not compute instructions in the defined order : it first adds all page break, then all OLE documents. I would like Jasper to add the first OLE document, then a page break, then the second OLE document, then a page break, and so on...

Here is my code. Do you know how to do that? I use Jasper Report version 6.8.0.

 

<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.8.0.final using JasperReports Library version 6.8.0-2ed8dfabb690ff337a5797129f2cd92902b0c87b  -->
<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="GET_ALL_LINKED_DOCUMENTS" pageWidth="612" pageHeight="842" columnWidth="612" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" whenResourceMissingType="Empty" uuid="de603a7d-4403-4173-a4b9-61aecb96f406">
    <property name="com.jaspersoft.studio.data.sql.tables" value=""/>
    <property name="net.sf.jasperreports.print.create.bookmarks" value="false"/>
    <property name="com.jaspersoft.studio.data.defaultdataadapter" value="XXXXX.xml"/>
    <parameter name="XXXXX_PARAM1" class="java.lang.String" isForPrompting="false">
        <parameterDescription><![CDATA[]]></parameterDescription>
    </parameter>
    <parameter name="XXXXX_PARAM2" class="java.lang.String" isForPrompting="false">
        <parameterDescription><![CDATA[]]></parameterDescription>
    </parameter>
    <parameter name="STYLE_TEMPLATE" class="java.net.URL" isForPrompting="false"/>
    <parameter name="RESOURCE_PATH" class="java.lang.String" isForPrompting="false"/>
    <queryString>
        <![CDATA[select OLE_OBJECT_ID from XXX where XXX=XXXXX_PARAM1 and YYY=XXXXX_PARAM2]]>
    </queryString>
    <field name="OLE_OBJECT_ID" class="java.lang.String">
        <property name="com.jaspersoft.studio.field.label" value="OLE_OBJECT_ID"/>
    </field>
    <background>
        <band splitType="Stretch"/>
    </background>
    <detail>
        <band height="20" splitType="Stretch">
            <subreport isUsingCache="true" runToBottom="true">
                <reportElement positionType="Float" mode="Transparent" x="0" y="0" width="612" height="20" isRemoveLineWhenBlank="true" uuid="b41ae55d-d96a-4a8e-8854-afa8f8db4904">
                    <property name="com.jaspersoft.studio.unit.height" value="pixel"/>
                </reportElement>
                <subreportParameter name="oleObjectId">
                    <subreportParameterExpression><![CDATA[$F{OLE_OBJECT_ID}]]></subreportParameterExpression>
                </subreportParameter>
                <subreportParameter name="STYLE_TEMPLATE">
                    <subreportParameterExpression><![CDATA[$P{STYLE_TEMPLATE}]]></subreportParameterExpression>
                </subreportParameter>
                <subreportParameter name="RESOURCE_PATH">
                    <subreportParameterExpression><![CDATA[$P{RESOURCE_PATH}]]></subreportParameterExpression>
                </subreportParameter>
                <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
                <subreportExpression><![CDATA[LOADSUB("GenericSubreportOleAttachment.jasper")]]></subreportExpression>
            </subreport>
        </band>
        <band height="50">
            <break>
                <reportElement x="0" y="0" width="99" height="1" uuid="3021991e-c925-4824-bded-d63f881cb0cc">
                    <property name="com.jaspersoft.studio.unit.y" value="px"/>
                </reportElement>
            </break>
            <staticText>
                <reportElement x="10" y="10" width="590" height="30" uuid="e46db91c-5d68-4247-a3fa-9b28b57b8fb0">
                    <property name="com.jaspersoft.studio.unit.y" value="px"/>
                    <property name="com.jaspersoft.studio.unit.x" value="px"/>
                </reportElement>
                <textElement textAlignment="Center">
                    <font size="14" isBold="false"/>
                </textElement>
                <text><![CDATA[Page let empty intentionally]]></text>
            </staticText>
            <break>
                <reportElement x="0" y="45" width="100" height="1" uuid="ea27cdf9-58ca-491e-be0c-7872b3cfdbbd">
                    <property name="com.jaspersoft.studio.unit.y" value="px"/>
                </reportElement>
            </break>
        </band>
    </detail>
</jasperReport>
Matthias.delamare's picture
Joined: Jun 28 2019 - 3:46am
Last seen: 1 month 2 days ago

0 Answers:

No answers yet
Feedback
randomness