Jump to content
We've recently updated our Privacy Statement, available here ×

Using Jasper Reports with Hibernate


Recommended Posts

By: stone_cold - bssai

Using Jasper Reports with Hibernate

2006-02-17 01:10

I have a query or concern with respect to the JasperDesign class of the Jasper reports.

 

Let me be more clear on wat i would like to say, If u see the examples or samples which are under the samples folder of JSR/demo/samples/noxmldesign/ provided along with the binary , this particular struture has been given for those who does nt want to use the designing tool or to be precise the .jrxml file.

 

I am ok with creating my own structure. But the problem i am facing is In the program u have to pass the query to fill the report.But i already have the data in the form of objects using Hibernate. Now if at all i pass on the query again..Does it mean that i am doing a repeatition of the code by executing the query twice.

 

Let me show us with example.

 

This part of the code is in jsr/demo/samples/noxmlDesign/noxmlDesignApp.java

 

//Query

JRDesignQuery query = new JRDesignQuery();

query.setText("SELECT * FROM Address $P!{OrderByClause}");

jasperDesign.setQuery(query);

 

 

Here is the click I dont want to send a query string again coz i have already got the queries data..i mean the result.

 

I hope u got my point.

 

Looking ahead for ur reply,

 

 

By: Teodor Danciu - teodord

RE: Using Jasper Reports with Hibernate

2006-02-17 02:11

 

Hi,

 

Supplying a query in the report template is optional.

If you already have you data in-memory, you could

wrap it using JRBeanCollectionDataSource implementation and pass this data source to the

report filling process.

 

Look at the supplied /demo/samples/datasource

sample provided with the project.

 

I hope this helps.

Teodor

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...