preload
1 Comment | Jul 20, 2010

FileMaker: Selective Summary Report

Estimated Time To Read This: 2 – 3 minutes      


In some cases, it can be beneficial to make a single report layout flexible enough to handle multiple reports. Hypothetically, let’s say that we have a Teacher Certificate system with the ability to generate and print teacher certificates, the accompanying letter, and restrictions (if any).

The problem is, that depending on whether the teacher is teaching an elementary, high school, or continuing education class, a different accompanying letter needs to be sent. Additionally, certain communities have restrictions that need to be included in the documentation, as is the case with some communities in Nunavut where alcohol is prohibited.

In FileMaker, when a Sub-summary part is sorted by its Break Field, the Sub-summary part will display. When the report is not sorted by the Break Field, the Sub-summary part will not display. We will make use of this behaviour to achieve the results we want.

The first thing we need to do is create dummy Break Fields for each of the parts you need in your report. These will be used to for sorting, even though they won’t actually contain values. Next, create a new layout and remove the Body part from the report. Add Sub-summaries for each part that you need and build the report.

Now from the script that generates the report, use conditions in If statements to determine which part you should be showing, and sort by that dummy field. (A sample of code is displayed below.) This makes it easy to manage a single layout that can control multiple reports without any duplication. So, in the event that something needs to be changed, it only needs to be changed in one place not in every version of the report. With one layout we can print six different variations of the report.


There are certainly other ways to tackle this challenge, but this is a clean, quick and simple way of doing it while at the same time, making it easy for the developer to manage in case changes are needed.

Go ahead, try it out!

Kevin McGee


Tags:, , , , ,





Related Articles


Trackbacks

  1. [...] This post was mentioned on Twitter by Kari Rennie, CoreSolutions.

Leave a Reply

* Required
** Your Email is never shared