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

Help with embedded ArrayList in Javabean


rauper

Recommended Posts

Hi all,

I'm fairly new to using Ireport, and I'm really struggling to get the report I need, and I'd be extremely greatful if somebody could help me a little.

I've built a database application based on JPA, the database app has 2 entity classes - 'Departments' and 'Employees'.

I've managed to print a report on the employee by simply using Parameters within a Map and substituting the parameters into text fields in my report as follows:

employeereport.jrxml

<parameter name="employeeName" class="java.lang.String"/>

<textField>
                <reportElement x="136" y="11" width="401" height="20"/>
                <textFieldExpression class="java.lang.String"><![CDATA[$P{employeeName}]]></textFieldExpression>

</textField>

and in my employee.java class

Map<String, Object> params = new HashMap<String, Object>();
params.put("employeeName", this.getEmployee().getEmployeeName());

 

Now I need to create a report for the department, but I cant for the life of me figure out how to simply print the list of employees from each department, which is an ArrayList<Employee> attribute of the Department class.

e.g.

Department 1

Employees:

Employee 1

Employee 2

Employee 3

Is there no simple way of passing a List parameter which prints a list of objects?

I've been trying to figure this out for weeks and it's driving me insane.

BTW I'm using netbeans with Ireport addon.

Thanks in advance for any replies.

 



Post Edited by rauper at 10/19/2010 11:41
Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

No replies :(

Someone must be able to help me.

I've spent weeks on this application and this is all i need to complete my project.

I'd be so greatful if someone could help me. Even if it's just pasting a link I can read (although ive scoured the web for answers and not found anything).

Many thanks,

 

 

 

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