Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Getting error in ireport

 
Greenhorn
Posts: 26
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone

I am generating a report through the beans does not work properly
however if I use within the iReport with SQL, it works well.

Error print:



SQL



ReportClass




ModelClass



Developing with: JSF 2.0, Hibernate and iReport 4.7


Any help, please? Maybe change the code in ReportClass to generate the report using SQL instead of bean... well.. I don't have idea how to do this
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy

First you need to make sure the iReport jar library version is the same as the software you use for create those templates.

Do you happen to have the report source (jrxml) file, rather than the compiled file (jasper)? If so how are you outputing the Customer and Owner fields?

If you have the report source, you can simply use Jasper's own library to compile then export



I'm not saying your approach is bad or wrong... just you can use the report source directly (preferably outside the war file) so that changes to reports will not affect web code.


 
Rafael Ra
Greenhorn
Posts: 26
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I have jrxml file. I use it to test these reports.
I will test your method when I get home.

I have changed some things in the code to get it from HLQ. But I was trying using SQL .. but its not working.. I don't know why
Any ideia? Look:





 
K. Tsang
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you use the report source JRXML, your sql I assume will be inside your report which will run as if you are using iReport.

The Hibernate HQL thing will be irrelevant.
 
Rafael Ra
Greenhorn
Posts: 26
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Right... I found an example using .jrxml but I have one question.

ExampleDAO:



ExampleReportClass



But I get error: "return new AnnotationConfiguration().configure().buildSettings().getConnectionProvider().getConnection();"



It could be a problem with the configuration of my HibernateUtil?
 
K. Tsang
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes from the looks of it.

Just for testing, you may want to use JDBC or connection pool (JNDI) to get that DB connection and see if it's Hibernate of simply the connection.
 
Rafael Ra
Greenhorn
Posts: 26
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Resolved.
Thanks everyone!


Changed from HLQ to SQL:



 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic