Jump to content

passing collection DataSource via java to jasper


itpragmatic

Recommended Posts

experts,

 

i have been working on passing collection datasource from java to jasper file. Something is going wrong. I will write the steps here how i am doing it and also attach the jrxml and java files.

1. Basically, i want to pass list of data to jasper file throgh java file so that it can generate the reports accordingly.

2. I have a master report,one sub report, one java file to write exporter's logic and a java bean file which includes getters and setters method.

3. Initially i thought of parameter of type object and pass the data via this object. It didn't work. I referred following thread to understand where i am going wrong.

http://jasperforge.org/plugins/espforum/view.php?group_id=83&forumid=101&topicid=73972

4. I created a java bean file which contains getters and setters methods and in main report i created a parameter along with a field which can hold list of data.

5. In main report i created field called workListDS and also the fileds which i declared in the java file to generate the report.

6. In subreport expression, i wrote  $F{workListDS} to get the list of data. Still I am not able show all beans. I can see only first bean which i had declared and not the rest. I don't know where i am committing mistake.

Also right now i am declaring those text fields on the main report. If i declare those on subreport (where i wish to declare). , report does not compile. PLease help.

PLease suggest your ideas and advices. I am attaching here my both jrxmls.java files and pdf files.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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