Jump to content

Mutliple one-to-many results in single report


traigo

Recommended Posts

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.relationship
From employee ee
Left Join employeeDepartment edept on ee.ee_id = edept.ee_id
Left Join department dept on dept.dept_id = edept.dept_id
Left join employeeDeduction eded on ee.ee_id = eded.ee_id
Left join deduction ded on eded.ded_id = ded.ded_id
Left join dependent dep on ee.ee_id = dep.ee_id

We 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

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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

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