0
votes

I'm trying to fetch the records and display it on the report using table component. When i'm uploading it in Jasper server, the very first page is divided into multiple pages again which i don't want. Is there any specific property that i need to set for not splitting the first page into multiple ?

Please find the below .jrxml code,

<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.9.0.final using JasperReports Library version 6.9.0-cb8f9004be492ccc537180b49c026951f4220bf3  -->
<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="Blank_A4_3" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="bb592687-f570-47d9-bbbd-a3c94f7e4d74">
    <property name="com.jaspersoft.studio.data.sql.tables" value="IkFDVElPTiIgQVMgLDgxLDEzNiw0OGY2MDU5OS0xNTgxLTQzZTQtOWZiMy04MzgxOWM1MjUxNWI7"/>
    <property name="com.jaspersoft.studio.data.defaultdataadapter" value="New Data Adapter(ATT Dev DS)"/>
    <style name="Table_TH" mode="Opaque" backcolor="#DC143C">
        <box>
            <pen lineWidth="0.5" lineColor="#000000"/>
            <topPen lineWidth="0.5" lineColor="#000000"/>
            <leftPen lineWidth="0.5" lineColor="#000000"/>
            <bottomPen lineWidth="0.5" lineColor="#000000"/>
            <rightPen lineWidth="0.5" lineColor="#000000"/>
        </box>
    </style>
    <style name="Table_CH" mode="Opaque" backcolor="#FFBFCC">
        <box>
            <pen lineWidth="0.5" lineColor="#000000"/>
            <topPen lineWidth="0.5" lineColor="#000000"/>
            <leftPen lineWidth="0.5" lineColor="#000000"/>
            <bottomPen lineWidth="0.5" lineColor="#000000"/>
            <rightPen lineWidth="0.5" lineColor="#000000"/>
        </box>
    </style>
    <style name="Table_TD" mode="Opaque" backcolor="#FFFFFF">
        <box>
            <pen lineWidth="0.5" lineColor="#000000"/>
            <topPen lineWidth="0.5" lineColor="#000000"/>
            <leftPen lineWidth="0.5" lineColor="#000000"/>
            <bottomPen lineWidth="0.5" lineColor="#000000"/>
            <rightPen lineWidth="0.5" lineColor="#000000"/>
        </box>
        <conditionalStyle>
            <conditionExpression><![CDATA[new Boolean($V{REPORT_COUNT}.intValue()%2==0)]]></conditionExpression>
            <style backcolor="#F6C4CE"/>
        </conditionalStyle>
    </style>
    <subDataset name="Dataset1" uuid="5345be9f-d468-47cd-a6e2-eee5cd32bdb6">
        <property name="com.jaspersoft.studio.data.sql.tables">
            <![CDATA[IlRFTkFOVCIgQVMgLDIwOSwxNTcsMGQ2MWQyNmEtYmM2NC00N2VmLTk3NzAtZjY3YjZlZjQxYmEw
Ow==]]>
        </property>
        <property name="com.jaspersoft.studio.data.defaultdataadapter" value="New Data Adapter(ATT Dev DS)"/>
        <queryString language="SQL">
            <![CDATA[SELECT "TENANT"."ID",
    "TENANT"."NAME",
    "TENANT"."FULLNAME",
    "TENANT"."TENANT_ID"
FROM "TENANT"]]>
        </queryString>
        <field name="ID" class="java.math.BigDecimal">
            <property name="com.jaspersoft.studio.field.label" value="ID"/>
        </field>
        <field name="NAME" class="java.lang.String">
            <property name="com.jaspersoft.studio.field.label" value="NAME"/>
        </field>
        <field name="FULLNAME" class="java.lang.String">
            <property name="com.jaspersoft.studio.field.label" value="FULLNAME"/>
        </field>
        <field name="TENANT_ID" class="java.math.BigDecimal">
            <property name="com.jaspersoft.studio.field.label" value="TENANT_ID"/>
        </field>
    </subDataset>
    <queryString language="SQL">
        <![CDATA[SELECT "ACTION"."ID",
    "ACTION"."ACTION_NAME"
FROM "ACTION"]]>
    </queryString>
    <field name="ID" class="java.math.BigDecimal">
        <property name="com.jaspersoft.studio.field.label" value="ID"/>
    </field>
    <field name="ACTION_NAME" class="java.lang.String">
        <property name="com.jaspersoft.studio.field.label" value="ACTION_NAME"/>
    </field>
    <title>
        <band height="79" splitType="Stretch">
            <staticText>
                <reportElement x="150" y="19" width="241" height="41" uuid="e6da46ab-de63-4c3e-8f37-3dfcb131f253"/>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font size="20" isBold="true"/>
                </textElement>
                <text><![CDATA[Tenant Data]]></text>
            </staticText>
        </band>
    </title>
    <detail>
        <band height="123" splitType="Stretch">
            <componentElement>
                <reportElement x="0" y="0" width="555" height="90" uuid="15b46540-ece2-49fe-94b8-5acdabbd94c9">
                    <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>
                    <property name="com.jaspersoft.studio.table.style.table_header" value="Table_TH"/>
                    <property name="com.jaspersoft.studio.table.style.column_header" value="Table_CH"/>
                    <property name="com.jaspersoft.studio.table.style.detail" value="Table_TD"/>
                    <property name="com.jaspersoft.studio.components.autoresize.proportional" value="true"/>
                </reportElement>
                <jr:table xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd">
                    <datasetRun subDataset="Dataset1" uuid="a79197cf-f11f-43a3-8d04-1ca7ed8a370a">
                        <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
                    </datasetRun>
                    <jr:column width="139" uuid="19e20a95-90c0-4811-a4f0-526ba776e0b8">
                        <jr:columnHeader style="Table_CH" height="30">
                            <staticText>
                                <reportElement x="0" y="0" width="139" height="30" uuid="d47dffba-2694-466d-9734-c941b5a30e20"/>
                                <text><![CDATA[ID]]></text>
                            </staticText>
                        </jr:columnHeader>
                        <jr:detailCell style="Table_TD" height="30">
                            <textField>
                                <reportElement x="0" y="0" width="139" height="30" uuid="b4157c84-55ad-4798-9eb5-871c55052e10"/>
                                <textFieldExpression><![CDATA[$F{ID}]]></textFieldExpression>
                            </textField>
                        </jr:detailCell>
                    </jr:column>
                    <jr:column width="139" uuid="414d9adb-bcab-4fb5-a16c-207a55fa9ab7">
                        <jr:columnHeader style="Table_CH" height="30">
                            <staticText>
                                <reportElement x="0" y="0" width="139" height="30" uuid="8f140390-7e1c-41dc-8449-87289b0ac82f"/>
                                <text><![CDATA[NAME]]></text>
                            </staticText>
                        </jr:columnHeader>
                        <jr:detailCell style="Table_TD" height="30">
                            <textField>
                                <reportElement x="0" y="0" width="139" height="30" uuid="deb91d5a-b2a4-4601-95ca-ca1ecedade3b"/>
                                <textFieldExpression><![CDATA[$F{NAME}]]></textFieldExpression>
                            </textField>
                        </jr:detailCell>
                    </jr:column>
                    <jr:column width="139" uuid="a1f3fe19-9528-4c59-b0a4-65e74539fa6d">
                        <jr:columnHeader style="Table_CH" height="30">
                            <staticText>
                                <reportElement x="0" y="0" width="139" height="30" uuid="6dc2c1cc-83c5-4d44-bcd5-cf8727ee052e"/>
                                <text><![CDATA[FULLNAME]]></text>
                            </staticText>
                        </jr:columnHeader>
                        <jr:detailCell style="Table_TD" height="30">
                            <textField>
                                <reportElement x="0" y="0" width="139" height="30" uuid="f2e00868-fa47-4ffd-8c22-1d792712b625"/>
                                <textFieldExpression><![CDATA[$F{FULLNAME}]]></textFieldExpression>
                            </textField>
                        </jr:detailCell>
                    </jr:column>
                    <jr:column width="138" uuid="9dd9b980-6906-4b3b-a1fb-64675d8eb9ee">
                        <jr:columnHeader style="Table_CH" height="30">
                            <staticText>
                                <reportElement x="0" y="0" width="138" height="30" uuid="bf146b41-131c-475d-bdda-cfe8c00c53f7"/>
                                <text><![CDATA[TENANT_ID]]></text>
                            </staticText>
                        </jr:columnHeader>
                        <jr:detailCell style="Table_TD" height="30">
                            <textField>
                                <reportElement x="0" y="0" width="138" height="30" uuid="def2cc28-ec90-4b22-9495-0535860b9440"/>
                                <textFieldExpression><![CDATA[$F{TENANT_ID}]]></textFieldExpression>
                            </textField>
                        </jr:detailCell>
                    </jr:column>
                </jr:table>
            </componentElement>
        </band>
    </detail>
    <pageFooter>
        <band height="54" splitType="Stretch">
            <staticText>
                <reportElement x="0" y="8" width="551" height="41" uuid="aa8ca21b-7b92-4806-8709-84c85e1224b9"/>
                <text><![CDATA[]]></text>
            </staticText>
            <textField evaluationTime="Report">
                <reportElement x="435" y="17" width="100" height="30" uuid="aff95681-5078-4989-b65f-6e5285593ce7"/>
                <textElement textAlignment="Left" verticalAlignment="Middle">
                    <font size="12" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA[" of " + $V{PAGE_NUMBER}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="336" y="17" width="100" height="30" uuid="5dfb2b9e-4a2a-4694-b528-bc0d2202374d"/>
                <textElement textAlignment="Right" verticalAlignment="Middle">
                    <font size="12" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA["Page " + $V{PAGE_NUMBER}]]></textFieldExpression>
            </textField>
        </band>
    </pageFooter>
</jasperReport>

Any help would be appreciated, thanks in advance.

1

1 Answers

1
votes

The report will spill over onto multiple pages if you have a lot of rows in your table.

If this is the case, you can reduce the height of the row of your table to try and make it fit on one page.

Also, by shrinking the height of the title and footer bands you'll give the table's detail band more room.