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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:48:59+00:00 2026-06-18T11:48:59+00:00

I use a Jasper as a report engine (using iReport -4.0.0) My datasource is

  • 0

I use a Jasper as a report engine (using iReport-4.0.0)
My datasource is XML file datasource and use XPath expression when filling the report
For example
Sample Data

<StudentList>
<Student>   
    <StdntCd>cd11</StdntCd>
    <StdntNm>ee11</StdntNm>
    <Schl>Schl11</Schl>
    <Cty>Cty11</Cty>
</Student>
<Student>   
    <StdntCd>cd22</StdntCd>
    <StdntNm>ee22</StdntNm>
    <Schl>Schl22</Schl>
    <Cty>Cty22</Cty>
</Student>
</StudentList>

And my XPath expression is that

/StudentList/Student

The issue happened when No data such that

<StudentList>

</StudentList>  

My need to show all section of the report without detail (because there is no data)
Although i set “When No Data” property with “All Sections,No Detail”
But still not work
Note
No data is equivalent to the previous XML NOT like that

<StudentList>
 <Student></Student>
</StudentList>
  • 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-18T11:49:01+00:00Added an answer on June 18, 2026 at 11:49 am

    In order to avoid this best is to define a printWhenExpression for the detail band.

    in iReport: click in report inspector on detail band, in properties panel modify printWhenExpression to $F{StdntCd} != null : this will only show students that do have a code other than null.

    If you utilize the REPORT_COUNT variable, you will need to add a custom variable instead:

    • type: java.lang.Integer
    • Calculation: Sum
    • Expression: $F{StdntCd} == null ? 0 : 1
    • Initial value: 0

    This will allow you all the time the correct output, assuming that the field StdntCd can never be null if valid data is provided.

    If your report runs with a different language than groovy you might need to adjust the expressions.

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

Sidebar

Related Questions

Jasper reports can use external templates and subreports referred in .jrxml file as follows:
I would like to use Jasper reports and build the report without templates. How
Have anyone tried to import user defined classes in jasper report (.jrxml file)? I
I have problem related to file protection when changed the Jasper Report output from
I am creating a simple reporting program using java and iReport (from jasper), which
Hi I am trying to use Jasper (4.0.2) reports with JBoss 6 using an
exporter.setParameter(JRHtmlExporterParameter.IMAGES_DIR_NAME, images/jasper_tmp/); exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, /images/jasper_tmp/); I'm using jasper report in a GWT project. My PROD
I've briefly looked at using Jasper Reports as a reporting engine. However it's all
I am currently building a XML based Jasper Report in which I am trying
I have a simple jasper report that does not need a datasource so I

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.