traigo Posted December 31, 2009 Share Posted December 31, 2009 I am writing a report that will show data from our HR DB. It's 1-page-per-employee and I want to show multiple one-to-many results per employee (payroll deductions, departments, dependents, etc.). Each employee can have 0 or more for each. We pass a custom datasource to the reports since we inject our own user security into the report queries. The basic query, with our security tacked on later, would be something like:Select ee.firstName, ee.lastName, dept.name, ded.name, ded.amount, dep.name,dep.relationshipFrom employee eeLeft Join employeeDepartment edept on ee.ee_id = edept.ee_idLeft Join department dept on dept.dept_id = edept.dept_idLeft join employeeDeduction eded on ee.ee_id = eded.ee_idLeft join deduction ded on eded.ded_id = ded.ded_idLeft join dependent dep on ee.ee_id = dep.ee_idWe have a generic report engine that generates the datasources but I can create a new action for this particular report if needed.How might I accomplish this? Thanks,Traigo Link to comment Share on other sites More sharing options...
lucianc Posted January 5, 2010 Share Posted January 5, 2010 If your custom data source keeps the data in memory, you can organize it in such a way that you would subreports (or list components) to show employee departments/etc. I.e. each master data source record would correspond to an employee, and there would be fields that provide the list of departments and so on.Regards,Lucian Link to comment Share on other sites More sharing options...
traigo Posted January 5, 2010 Author Share Posted January 5, 2010 Like having a datasource which is employee. There's the usual fields, first, last, SSN, etc. then an ArrayList<String> of the departments? Jasper will just print the list for $F{departments}? Link to comment Share on other sites More sharing options...
lucianc Posted January 6, 2010 Share Posted January 6, 2010 JR will print the list of departments if you use either a subreport or a list component.Regards,Lucian Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now