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

The Archive Base Latest Questions

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

I am generating the reports using ireport-4.5.0. I am using JRBeanCollectionDatasource . To this

  • 0

I am generating the reports using ireport-4.5.0. I am using JRBeanCollectionDatasource. To this datasource I am sending the list of objects. I am using JPA query to get the result list.

In this query if I give SELECT m from mobile m it is working fine and generating the report, but if I give SELECT m.title,m.gender from mobile m then it is giving exception. It is not able to find the attribute.

What to do to resolve this issue? Can any one tell me how to resolve this? I am strucked up here from so many days. Sorry for my poor English.

Thanks In Advance.

  • 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:56:41+00:00Added an answer on June 14, 2026 at 3:56 am

    Your second query does not return a collection of beans, but rather a collection of arrays (Object[]), that all have two elements: title and gender. The array does not have properties (you cannot call getGender of getTitle on it), and hence the exception.

    You have a vast array of solutions:

    • write a simple bean (eg. TitleGener) that only has two properties: gender and title. It should also have a constructor that initializes both of them. Then change your JPA query to: SELECT new my.utils.TitleGender(m.title,m.gender) from mobile m. This way you will get a collection of beans that actually do have the required properties. This is the quickest fix.

    • do not JRBeanCollectionDataSource at all, just use the standard JDBC data source. You do not seem to understand how JPA works anyway, so it is doubtful if you need it. This is – in my opinion – the best choice.

    • write a simple, specialized JRDataSource that wraps Object[]. The interface only has two methods and is simple to implement – the main point will be translation from the name of the property to its index int Object[], in your case the translation will be hard-coded. This is what I would do.

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

Sidebar

Related Questions

Using iReport, I am generating reports to be viewed in multiple formats. Is it
The situation: I am generating reports using Report Builder 2.0 and a Report Model
I'm using Rave to generate reports, but it's poor at generating Word docs. My
I'm generating a page using jsp, it has a list element which shows a
I'm generating clover coverage reports (using Clover's maven plugin), and I'd like to exclude
I am using Microsoft SQL Server 2008. While generating custom reports, I need to
I am generating reports using HTML and I am using CSS to control the
I am generating reports in .xlsx using PHPExcel. It was okay in the initial
Possible Duplicate: Generating excel documents programmatically I want to generate excel reports using Java/J2EE.
I'm using Crystal reports that is embedded in Visual Studio 2008. I'm generating a

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.