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

Reference list of objects in jrdatasource


imrank1

Recommended Posts

I'm returning an object that implements JRDataSource back to my report file. This object contains a collection of objects in the following manner :

ServerDatasource implements JRDataSource {

List<Server> servers

Server server;

next ( ) {

//returns the next Server in the list of Servers

}

 

getFieldValue(JRField field){

//returns the server object

if ( "server".equals(field.getName())

{

return server;

}

}

 

}

Server {

 List<Data> dataList;

 List<ServerChild> children

}

 

ServerChildren {

List<Data> dataList;

 

}

Data {

//some data points

 

What I want to do is when I have a Server object I want to iterate through his Data objects and show the fields in each of them. Then I want to iterate over that Server objects ServerChildren and iterate over their Data objects and show their values as well. However I am not seeing a way to do a "for each Data " or "for each ServerChild" in the jrxml via the $F syntax. Is this possible or do I need to use subreports?

Thanks

 

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