Jump to content
We've recently updated our Privacy Statement, available here ×
  • Second subreport starts in a new page always


    Jim W
    • Features: Reports Version: v8 Product: JasperReports® Library

    Problem Description

    If you have 2 subreports in the summary band,  The first one starts in the middle of the page where the summary band is.  A second subreport with the exact declarations for some reason always starts in a new page.  But you want both subreports to run continuously with no blank space in between.

    Solution

    Be sure to set both subreports with runToBottom to false, and stretch type to NoStretch.  You can start with this working sample and add what ever else you want to change.

     

        <summary>
            <band height="458" splitType="Immediate">
                <subreport isUsingCache="true" runToBottom="false">
                    <reportElement positionType="Float" x="0" y="0" width="572" height="0" isRemoveLineWhenBlank="true" isPrintInFirstWholeBand="true" uuid="9ba40442-05ff-483c-8d0f-f84dc2238114">
                        <property name="net.sf.jasperreports.band.split.allowed" value="true"/>
                    </reportElement>
                    <subreportParameter name="P1">
                        <subreportParameterExpression><![CDATA[$P{P1}]]></subreportParameterExpression>
                    </subreportParameter>
                    <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
                    <subreportExpression><![CDATA["Sub1.jrxml"]]></subreportExpression>
                </subreport>
                <subreport isUsingCache="true" runToBottom="false">
                    <reportElement positionType="Float" x="0" y="21" width="572" height="0" isRemoveLineWhenBlank="true" isPrintInFirstWholeBand="true" uuid="515eefdc-9ab1-4af0-a3cf-2667ef6276a3">
                        <property name="net.sf.jasperreports.band.split.allowed" value="true"/>
                    </reportElement>
                    <subreportParameter name="P1">
                        <subreportParameterExpression><![CDATA[$P{P1}]]></subreportParameterExpression>
                    </subreportParameter>
                    <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
                    <subreportExpression><![CDATA["Sub2.jrxml"]]></subreportExpression>
                </subreport>
            </band>
        </summary>


    User Feedback

    Recommended Comments

    There are no comments to display.



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...