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 6325831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:58:08+00:00 2026-05-24T16:58:08+00:00

I started working with subreports in JapserReports. At the beginning I would like to

  • 0

I started working with subreports in JapserReports. At the beginning I would like to do something very simple.
This is xml code of my 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="Rb50dane" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="0" bottomMargin="0">
    <property name="ireport.zoom" value="1.0"/>
    <property name="ireport.x" value="0"/>
    <property name="ireport.y" value="0"/>
    <field name="column01" class="java.lang.String"/>
    <background>
        <band splitType="Stretch"/>
    </background>
    <title>
        <band splitType="Stretch"/>
    </title>
    <pageHeader>
        <band splitType="Stretch"/>
    </pageHeader>
    <columnHeader>
        <band splitType="Stretch"/>
    </columnHeader>
    <detail>
        <band height="22" splitType="Stretch">
            <textField>
                <reportElement x="208" y="0" width="257" height="22"/>
                <box>
                    <pen lineWidth="3.25"/>
                    <topPen lineWidth="3.25"/>
                    <leftPen lineWidth="3.25"/>
                    <bottomPen lineWidth="3.25"/>
                    <rightPen lineWidth="3.25"/>
                </box>
                <textElement/>
                <textFieldExpression class="java.lang.String"><![CDATA[$F{column01}]]></textFieldExpression>
            </textField>
        </band>
    </detail>
    <columnFooter>
        <band splitType="Stretch"/>
    </columnFooter>
    <pageFooter>
        <band splitType="Stretch"/>
    </pageFooter>
    <summary>
        <band splitType="Stretch"/>
    </summary>
</jasperReport>

And this is part of my main report code:

<detail>
        <band height="22" splitType="Stretch">
            <subreport>
                <reportElement x="208" y="0" width="257" height="22"/>
                <dataSourceExpression><![CDATA[]]></dataSourceExpression>
                <subreportExpression class="java.lang.String"><![CDATA["C:\\Users\\mg\\Jasper\\Rb50data.jasper"]]></subreportExpression>
            </subreport>
        </band>
    </detail>

As you can see I do not use any parameter in my subreport. Unfortunately, in iReport after compiling my main report, subreport is not displayed, but when I try to run my subreport separately it works.

In my test I use empty data source. I just want to see the column with null value to find out whether the subreport works fine.

  • 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-05-24T16:58:09+00:00Added an answer on May 24, 2026 at 4:58 pm

    I’d try adding something in the dataSourceExpression of the parent report. Maybe send the whole data source by using *

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

Sidebar

Related Questions

I just started working with assembly so this is probably a really simple question,
I've just started working with Dapper and I don't seem to find something very
Just started working with Mercurial a few days ago and there's something I don't
I just started working with jqGrid this week. I'm attempting to make a generic
I've started working on a basic instant search tool. This is a workflow draft.
Two days ago I started working on a code parser and I'm stuck. How
I started working on a web application. This application needs lot of image handling.
I have just started working on localization of this application. Starting with three tab
I have only recently started working with the MVC approach, so I suppose this
I just started working with clickable TextViews in Eclipse. The line in the code

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.