Jump to content

Merge cell in table footer


Recommended Posts

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Set Height to 0 for the footer cells you don't want.

Example:

<?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.20.0.final using JasperReports Library version 6.1.1  --><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_Landscape_1" pageWidth="842" pageHeight="595" orientation="Landscape" whenNoDataType="AllSectionsNoDetail" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="d670a5fc-7f7c-4af6-91f1-4121b99da744">    <style name="Table" isDefault="true">        <box>            <pen lineWidth="0.5"/>        </box>    </style>    <style name="Table_CH" style="Table" mode="Opaque" backcolor="#BFE1FF"/>    <subDataset name="Dataset1" uuid="d0afc712-a54d-4808-9c1e-6e0b584bfc7a">        <field name="_THIS" class="java.lang.String"/>    </subDataset>    <title>        <band height="118">            <componentElement>                <reportElement x="0" y="0" width="800" height="100" uuid="5b169c2d-2ddc-47f9-a8c2-75aa2967bd47"/>                <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="7d33a1b3-8fa6-4c55-9224-d6bcbbe8c83d">                        <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource(java.util.Arrays.asList(new String[] { "A", "B", "C", "D" }))]]></dataSourceExpression>                    </datasetRun>                    <jr:columnGroup width="178" uuid="056c1cbb-44f4-4163-bcb4-ba7d1c4a39bd">                        <property name="com.jaspersoft.studio.components.table.model.column.name" value="Columns [2]"/>                        <jr:columnFooter style="Table_CH" height="30" rowSpan="1">                            <staticText>                                <reportElement x="0" y="0" width="178" height="30" uuid="353e4ea5-3bb1-4981-a476-5c5dcc4e92be"/>                                <textElement textAlignment="Center"/>                                <text><![CDATA[spanned Footer]]></text>                            </staticText>                        </jr:columnFooter>                        <jr:column width="89" uuid="c8cd84ef-9a85-4618-832e-0df32c1e994a">                            <property name="com.jaspersoft.studio.components.table.model.column.name" value="Column1"/>                            <jr:columnHeader style="Table_CH" height="30" rowSpan="1">                                <staticText>                                    <reportElement x="0" y="0" width="89" height="30" uuid="9c6e198d-f50a-477c-a468-df31e74b4e50"/>                                    <text><![CDATA[Foobar]]></text>                                </staticText>                            </jr:columnHeader>                            <jr:columnFooter style="Table_CH" height="0" rowSpan="1">                                <property name="com.jaspersoft.studio.unit.height" value="px"/>                            </jr:columnFooter>                            <jr:detailCell style="Table" height="30">                                <textField>                                    <reportElement x="0" y="0" width="89" height="30" uuid="775d75f0-ffdd-4bc6-aa68-fa6177c2cc83"/>                                    <textFieldExpression><![CDATA[$F{_THIS}]]></textFieldExpression>                                </textField>                            </jr:detailCell>                        </jr:column>                        <jr:column width="89" uuid="6dcea097-22ca-43a0-bcc7-c48cf6ea2ae7">                            <property name="com.jaspersoft.studio.components.table.model.column.name" value="Column2"/>                            <jr:columnHeader style="Table_CH" height="30" rowSpan="1">                                <staticText>                                    <reportElement x="0" y="0" width="89" height="30" uuid="a804c276-7841-455f-8503-e1966f751d2d"/>                                    <text><![CDATA[bar]]></text>                                </staticText>                            </jr:columnHeader>                            <jr:columnFooter style="Table_CH" height="0" rowSpan="1">                                <property name="com.jaspersoft.studio.unit.height" value="px"/>                            </jr:columnFooter>                            <jr:detailCell style="Table" height="30">                                <textField>                                    <reportElement x="0" y="0" width="89" height="30" uuid="b93c246a-3a9b-4695-96d8-5eecbcbf9cde"/>                                    <textFieldExpression><![CDATA["bar"]]></textFieldExpression>                                </textField>                            </jr:detailCell>                        </jr:column>                    </jr:columnGroup>                    <jr:column width="89" uuid="04cd569d-42ca-46e3-a6b7-005b3b3900ba">                        <property name="com.jaspersoft.studio.components.table.model.column.name" value="Column3"/>                        <jr:columnHeader style="Table_CH" height="30" rowSpan="1">                            <staticText>                                <reportElement x="0" y="0" width="89" height="30" uuid="6136ef01-5687-41e9-8973-441f674c51c5"/>                                <text><![CDATA[bag]]></text>                            </staticText>                        </jr:columnHeader>                        <jr:columnFooter style="Table_CH" height="30" rowSpan="2">                            <staticText>                                <reportElement x="0" y="0" width="89" height="30" uuid="62306c92-daf8-4ea4-9cfc-62381e243b39"/>                                <text><![CDATA[bag ?]]></text>                            </staticText>                        </jr:columnFooter>                        <jr:detailCell style="Table" height="30">                            <textField>                                <reportElement x="0" y="0" width="89" height="30" uuid="feaae1d2-9505-4bf3-a856-ee6e3ea96764"/>                                <textFieldExpression><![CDATA["bag"]]></textFieldExpression>                            </textField>                        </jr:detailCell>                    </jr:column>                </jr:table>            </componentElement>        </band>    </title></jasperReport>[/code]

 

 

Link to comment
Share on other sites

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...