Jump to content
JasperReports Library 7.0 is now available ×

How to add empty rows table


r.reddy.galla

Recommended Posts

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

check this jrxml. the trick is all in the querying techniques.

I'm using oracle. you can do the samething on other databases too.

 

<?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.2.0.final using JasperReports Library version 6.2.0  --><!-- 2017-05-11T09:04:28 --><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="empty_table" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="bccfd59a-8725-4ee9-b36b-b2a9fe2f7189">    <style name="Table_TH" mode="Opaque" backcolor="#F0F8FF">        <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="#BFE1FF">        <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>    </style>    <subDataset name="null" uuid="0c7ef6fb-a5e1-437d-87a4-1898ba4fc14f">        <property name="com.jaspersoft.studio.data.sql.tables" value=""/>        <property name="com.jaspersoft.studio.data.defaultdataadapter" value="PRODSUP"/>        <queryString>            <![CDATA[select null as ID, null as ID2, null as ID3, null as ID4, null as ID5  from dualunion allselect null as ID, null as ID2, null as ID3, null as ID4, null as ID5  from dualunion allselect null as ID, null as ID2, null as ID3, null as ID4, null as ID5  from dualunion allselect null as ID, null as ID2, null as ID3, null as ID4, null as ID5  from dualunion allselect null as ID, null as ID2, null as ID3, null as ID4, null as ID5  from dualunion allselect null as ID, null as ID2, null as ID3, null as ID4, null as ID5  from dual]]>        </queryString>        <field name="ID" class="java.lang.String"/>        <field name="ID2" class="java.lang.String"/>        <field name="ID3" class="java.lang.String"/>        <field name="ID4" class="java.lang.String"/>        <field name="ID5" class="java.lang.String"/>    </subDataset>    <queryString>        <![CDATA[select * From dual]]>    </queryString>    <field name="DUMMY" class="java.lang.String"/>    <background>        <band splitType="Stretch"/>    </background>    <detail>        <band height="30" splitType="Stretch">            <textField>                <reportElement x="0" y="0" width="100" height="30" uuid="b5a9e850-df88-4c6b-9ecd-bec44fb49a01"/>                <textFieldExpression><![CDATA[$F{DUMMY}]]></textFieldExpression>            </textField>        </band>    </detail>    <summary>        <band height="40" splitType="Stretch">            <componentElement>                <reportElement x="0" y="0" width="500" height="40" uuid="f2ee7347-c554-4add-9b8b-6f47292eb756">                    <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>                </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="null" uuid="7d8d7b3d-f6dd-4d7f-a4b2-82a80a132c88">                        <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>                    </datasetRun>                    <jr:column width="100" uuid="8169a126-a84b-40b3-bc3a-df116bd8f27f">                        <property name="com.jaspersoft.studio.unit.width" value="pixel"/>                        <property name="com.jaspersoft.studio.unit.height" value="pixel"/>                        <jr:columnHeader style="Table_CH" height="20">                            <property name="com.jaspersoft.studio.unit.height" value="px"/>                        </jr:columnHeader>                        <jr:detailCell style="Table_TD" height="20">                            <property name="com.jaspersoft.studio.unit.width" value="px"/>                            <property name="com.jaspersoft.studio.unit.height" value="px"/>                            <textField isBlankWhenNull="true">                                <reportElement x="0" y="0" width="100" height="20" uuid="90bfc973-fad6-442a-be2d-cbdcc9922a24"/>                                <textFieldExpression><![CDATA[$F{ID}]]></textFieldExpression>                            </textField>                        </jr:detailCell>                    </jr:column>                    <jr:column width="100" uuid="bf4bafeb-e404-4f9e-aa48-11cba71657c0">                        <jr:columnHeader style="Table_CH" height="20">                            <property name="com.jaspersoft.studio.unit.height" value="px"/>                        </jr:columnHeader>                        <jr:detailCell style="Table_TD" height="20">                            <property name="com.jaspersoft.studio.unit.width" value="px"/>                            <property name="com.jaspersoft.studio.unit.height" value="px"/>                            <textField isBlankWhenNull="true">                                <reportElement x="0" y="0" width="100" height="20" uuid="11506e05-c8fa-46df-b4fc-7423403f27e5"/>                                <textFieldExpression><![CDATA[$F{ID2}]]></textFieldExpression>                            </textField>                        </jr:detailCell>                    </jr:column>                    <jr:column width="100" uuid="97b80891-a47c-43e8-8b0d-83e3499648b0">                        <jr:columnHeader style="Table_CH" height="20">                            <property name="com.jaspersoft.studio.unit.height" value="px"/>                        </jr:columnHeader>                        <jr:detailCell style="Table_TD" height="20">                            <property name="com.jaspersoft.studio.unit.width" value="px"/>                            <property name="com.jaspersoft.studio.unit.height" value="px"/>                            <textField isBlankWhenNull="true">                                <reportElement x="0" y="0" width="100" height="20" uuid="c8572e3a-1ee6-4381-915a-91eb32a0ca1e"/>                                <textFieldExpression><![CDATA[$F{ID3}]]></textFieldExpression>                            </textField>                        </jr:detailCell>                    </jr:column>                    <jr:column width="100" uuid="ec98c14f-6291-458f-87f0-9fcd8173ea4d">                        <jr:columnHeader style="Table_CH" height="20">                            <property name="com.jaspersoft.studio.unit.height" value="px"/>                        </jr:columnHeader>                        <jr:detailCell style="Table_TD" height="20">                            <property name="com.jaspersoft.studio.unit.width" value="px"/>                            <property name="com.jaspersoft.studio.unit.height" value="px"/>                            <textField isBlankWhenNull="true">                                <reportElement x="0" y="0" width="100" height="20" uuid="5539cd6a-e354-4b47-b3d0-662daf49a000"/>                                <textFieldExpression><![CDATA[$F{ID4}]]></textFieldExpression>                            </textField>                        </jr:detailCell>                    </jr:column>                    <jr:column width="100" uuid="6824bd57-c6dc-4e60-9f9f-ab499cec0e43">                        <jr:columnHeader style="Table_CH" height="20">                            <property name="com.jaspersoft.studio.unit.height" value="px"/>                        </jr:columnHeader>                        <jr:detailCell style="Table_TD" height="20">                            <property name="com.jaspersoft.studio.unit.width" value="px"/>                            <property name="com.jaspersoft.studio.unit.height" value="px"/>                            <textField isBlankWhenNull="true">                                <reportElement x="0" y="0" width="100" height="20" uuid="e84363a1-eb3f-4fb9-92ce-747444e9f5e6"/>                                <textFieldExpression><![CDATA[$F{ID5}]]></textFieldExpression>                            </textField>                        </jr:detailCell>                    </jr:column>                </jr:table>            </componentElement>        </band>    </summary></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...