FMP16 - One to many report without using portal

48 views Asked by At

Seeking assistance in creating a one-to-many report in FileMaker Pro 16 without using portals.

I have two tables - the first is 'employees' and the second is 'leaves'. These two tables are related using a common field 'employeeid'.

I need to create a report (ultimately saved as a pdf) that will generate a single page per employee. The employee name should be at the top of the page, and all the leave records for the employee should be listed. I would like to create this report without using the portal feature, as the number of related leave records can be quite numerous. Can you explain how to accomplish this?

I have tried placing the employee name in the header section, and fields from the leaves table in the body section, but when I'm in browse mode, as I step through each employee, I am getting ALL leave records from the leaves table - instead of just those belonging to the employee listed in the header. The two tables are properly linked in database relationships.

Help?

1

There are 1 answers

2
michael.hor257k On

Your report layout needs to be a list layout of the Leaves table. It needs to have (at minimum) a body part and a sub-summary (when sorted by employeeid) part.

Place fields from the Leaves table in the body part, and fields from the Employees table in the sub-summary part.

In the sub-summary part's definition, select the option of 'Page break before each occurrence'.

Find the leaves you want to report on and sort them by employeeid.

Note that employees that do not have leaves in the found set will not be included in the report (if that's a problem, you can easily append another report of them).