Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8812545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:37:50+00:00 2026-06-14T03:37:50+00:00

I am trying to create a sub report( report1_subreport3.jrxml ) from the main report(

  • 0

I am trying to create a sub report(report1_subreport3.jrxml) from the main report(report1.jrxml) using iReport designer (both with empty data source) . The main report detail band contains a static text (“Main Report”) and the subreport element and the subreport contains a static text in its corresponding detail band(“Sub Report”)

But clicking the preview tab of the main report shows only static text “Main Report” not displaying the static text of subreport (“Sub Report”) .

I also went through the link http://community.jaspersoft.com/questions/524978/empty-subreport-xml-datasource-ireport but still facing the issue .

Below is the report1.jrxml

<?xml version="1.0" encoding="UTF-8"?>
<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="report1" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="20036b98-ef64-4dea-8345-b89bcd8f2671">
    <property name="ireport.zoom" value="1.0"/>
    <property name="ireport.x" value="0"/>
    <property name="ireport.y" value="68"/>
    <parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">
        <defaultValueExpression><![CDATA["D:\\soapReport\\jasperReport\\"]]></defaultValueExpression>
    </parameter>
    <background>
        <band splitType="Stretch"/>
    </background>
    <title>
        <band height="79" splitType="Stretch"/>
    </title>
    <pageHeader>
        <band height="35" splitType="Stretch"/>
    </pageHeader>
    <columnHeader>
        <band height="61" splitType="Stretch"/>
    </columnHeader>
    <detail>
        <band height="125" splitType="Stretch">
            <staticText>
                <reportElement uuid="d49ee6bf-1a13-41bb-9feb-f0fb2ec414f2" x="71" y="28" width="100" height="20"/>
                <textElement/>
                <text><![CDATA[Main Report]]></text>
            </staticText>
            <subreport>
                <reportElement uuid="364d3c38-a0a1-4fa5-b0bf-12b22314ac5e" x="311" y="14" width="200" height="100"/>
                <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
                <subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "report1_subreport3.jasper"]]></subreportExpression>
            </subreport>
        </band>
    </detail>
    <columnFooter>
        <band height="45" splitType="Stretch"/>
    </columnFooter>
    <pageFooter>
        <band height="54" splitType="Stretch"/>
    </pageFooter>
    <summary>
        <band height="42" splitType="Stretch"/>
    </summary>
</jasperReport>

and below is the report1_subreport3.jrxml

<?xml version="1.0" encoding="UTF-8"?>
<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="report1_subreport3" language="groovy" pageWidth="555" pageHeight="802" columnWidth="555" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="7ca2d973-972c-4c56-8d5e-503b32b4afc6">
    <property name="ireport.zoom" value="1.0"/>
    <property name="ireport.x" value="0"/>
    <property name="ireport.y" value="0"/>
    <background>
        <band splitType="Stretch"/>
    </background>
    <title>
        <band height="79" splitType="Stretch"/>
    </title>
    <pageHeader>
        <band height="35" splitType="Stretch"/>
    </pageHeader>
    <columnHeader>
        <band height="61" splitType="Stretch"/>
    </columnHeader>
    <detail>
        <band height="125" splitType="Stretch">
            <staticText>
                <reportElement uuid="5f488fe4-f9f7-4f12-9c1e-812661026bd7" x="222" y="50" width="100" height="20"/>
                <textElement/>
                <text><![CDATA[Sub Report]]></text>
            </staticText>
        </band>
    </detail>
    <columnFooter>
        <band height="45" splitType="Stretch"/>
    </columnFooter>
    <pageFooter>
        <band height="54" splitType="Stretch"/>
    </pageFooter>
    <summary>
        <band height="42" splitType="Stretch"/>
    </summary>
</jasperReport>

Thanks in advance for any help on that …


Thanks Gopi for the change, but still it is showing the blank in the place of subreport . Below is the main report

<?xml version="1.0" encoding="UTF-8"?>
<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="report1" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="748f862c-3467-4c8c-89f6-04a571192482">
    <property name="ireport.zoom" value="1.0"/>
    <property name="ireport.x" value="0"/>
    <property name="ireport.y" value="0"/>
    <parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">
        <defaultValueExpression><![CDATA["D:/soapReport/jasperReport/"]]></defaultValueExpression>
    </parameter>
    <queryString>
        <![CDATA[]]>
    </queryString>
    <background>
        <band splitType="Stretch"/>
    </background>
    <title>
        <band height="79" splitType="Stretch"/>
    </title>
    <pageHeader>
        <band height="35" splitType="Stretch"/>
    </pageHeader>
    <columnHeader>
        <band height="61" splitType="Stretch"/>
    </columnHeader>
    <detail>
        <band height="71" splitType="Stretch">
            <staticText>
                <reportElement uuid="17f2cfc8-497a-4676-b83a-acf55bccac04" x="33" y="15" width="100" height="20"/>
                <textElement/>
                <text><![CDATA[Main Report]]></text>
            </staticText>
        </band>
    </detail>
    <columnFooter>
        <band height="134" splitType="Stretch">
            <subreport>
                <reportElement uuid="40f53bea-c9eb-46a7-b4fc-3d592da3ef90" x="234" y="17" width="200" height="100"/>
                <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
                <subreportExpression><![CDATA["D:/soapReport/jasperReport/report1_subreport1.jasper"]]></subreportExpression>
            </subreport>
        </band>
    </columnFooter>
    <pageFooter>
        <band height="54" splitType="Stretch"/>
    </pageFooter>
    <summary>
        <band height="42" splitType="Stretch"/>
    </summary>
</jasperReport>       

and below is the subreport

<?xml version="1.0" encoding="UTF-8"?>
<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="report1_subreport1" language="groovy" pageWidth="555" pageHeight="802" whenNoDataType="AllSectionsNoDetail" columnWidth="555" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="62bf7fb7-8145-4aa6-b963-c98eefac9862">
    <property name="ireport.zoom" value="1.0"/>
    <property name="ireport.x" value="0"/>
    <property name="ireport.y" value="0"/>
    <background>
        <band splitType="Stretch"/>
    </background>
    <columnHeader>
        <band height="61" splitType="Stretch">
            <staticText>
                <reportElement uuid="9bf9eafc-c1e0-49fa-8bb8-ed6c496498da" x="213" y="20" width="100" height="20"/>
                <textElement/>
                <text><![CDATA[Sub Report]]></text>
            </staticText>
        </band>
    </columnHeader>
</jasperReport>

PLease help me if I am missing something…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T03:37:51+00:00Added an answer on June 14, 2026 at 3:37 am

    Place your sub-report field in the any other band other than detail band and add whenNoDataType="AllSectionsNoDetail" to your xml file.
    Add it among the other report properties in <JasperReport> tag.
    You can also add using the GUI Designer.
    Open your sub report and in the properties editor, at the end of the options you will find
    When No Data option. Select All Sections with No Detail from the list of available options.

    Mainreport :

    <?xml version="1.0" encoding="UTF-8"?>
    <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="report1" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
    <property name="ireport.zoom" value="1.0"/>
    <property name="ireport.x" value="0"/>
    <property name="ireport.y" value="12"/>
    <parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">
        <defaultValueExpression><![CDATA["/home/qualian/Desktop/gopi/prjreport/"]]></defaultValueExpression>
    </parameter>
    <queryString>
        <![CDATA[]]>
    </queryString>
    <background>
        <band splitType="Stretch"/>
    </background>
    <title>
        <band height="79" splitType="Stretch"/>
    </title>
    <pageHeader>
        <band height="35" splitType="Stretch"/>
    </pageHeader>
    <columnHeader>
        <band height="61" splitType="Stretch"/>
    </columnHeader>
    <detail>
        <band height="125" splitType="Stretch">
            <subreport>
                <reportElement x="33" y="56" width="208" height="36"/>
                <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
                <subreportExpression class="java.lang.String"><![CDATA[$P{SUBREPORT_DIR}+"report3_subreport1.jasper"]]></subreportExpression>
            </subreport>
            <staticText>
                <reportElement x="33" y="15" width="100" height="20"/>
                <textElement/>
                <text><![CDATA[Main Report]]></text>
            </staticText>
        </band>
    </detail>
    <columnFooter>
        <band height="45" splitType="Stretch"/>
    </columnFooter>
    <pageFooter>
        <band height="54" splitType="Stretch"/>
    </pageFooter>
    <summary>
        <band height="42" splitType="Stretch"/>
    </summary>
    


    Sub report:

    <?xml version="1.0" encoding="UTF-8"?>
    <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="report1_subreport3" language="groovy" pageWidth="555" pageHeight="802" whenNoDataType="AllSectionsNoDetail" columnWidth="555" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0">
    <property name="ireport.zoom" value="1.0"/>
    <property name="ireport.x" value="0"/>
    <property name="ireport.y" value="0"/>
    <background>
        <band splitType="Stretch"/>
    </background>
    <columnHeader>
        <band height="40" splitType="Stretch">
            <staticText>
                <reportElement x="107" y="12" width="100" height="20"/>
                <textElement/>
                <text><![CDATA[Sub Report]]></text>
            </staticText>
        </band>
    </columnHeader>
    


    This worked like a charm. Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a drop-down menu acting as the sub-menu of a main
I am trying to create a report with 2 sub-reports for new and used
I am trying to create a sub listview page separate from the typical caged
I am trying to create a data table using Jasper reports. I am using
I'm trying to create a sub folder using the Live Connect API for the
I'm trying to create a sub-query to obtain the latest date from a table,
i'm trying to create a Dynamic Sub-menu to use it in Wordpress, Something like
I'am trying to create a navigation menu with a sub menu, and fiddled with
I am trying to create a multi project template. I wish the sub projects
I'm trying create a bot which automatically likes Facebook posts. Using Mechanize I can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.