Jump to content
Changes to the Jaspersoft community edition download ×

Dynamic Data Generation in Jasper Report


darma

Recommended Posts

Dynamic Data Generation in Jasper Report

 

I am new to Jasper Report. I am currently using Jasper Report v. 1.2.7

 

I wanted to generate the report dynamically:-

 

For example

 

I wanted to show the following information in my report.

<br>

1. Name: ram

age : 20

working: yes

company name: xxx and co

salaried: yes

salary: rs. 20000

 

2. name: kumar

age: 10

working: no

 

3. name: latha

age: 50

working: yes

company name: xxx and co

salaried: no

 

 

The number of line in each section may vary depending upon the data(information).

 

How do I generate these kind of dynamic data.

 

From my java passing the values to Jasper Report in Hashmap.

 

Please help.

 

 

- DARMA

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

How do I generate these kind of dynamic data.
From my java passing the values to Jasper Report in Hashmap.

You have to supply some kind of data source, either an instance of e.g. JRBeanArrayDataSource or a database connection. A report will not show up if it isn't provided with some RESULTS from your DATASOURCE. AFAIK just passing values in a hashmap won't work.

But you should be able to read that up in the (sketchy) Jasper documentation.

 

Regards

Link to comment
Share on other sites

You can provide the below fields in common for all the 3 cases. As the last 3 fields are displayed based on the condition "working", you can use the "Print When Expression" condition for each of the fields. If Working = YES, display the 3 fields.

 

 

Name: ram

age : 20

working: yes

company name: xxx and co

salaried: yes

salary: rs. 20000

Link to comment
Share on other sites

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...