If you want data from the fields of the most current meeting record to appear in the title header, that record must be the first in the sort order. But see below …
Should I even have a title header?
I'm not sure if you're asking about a header in general, or a title header specifically …
It might be worthwhile to create a mockup of how the report should look, and only when you have a clear concept, try to re-create that look in the layout. Then such questions often answer themselves.
Also, consider the function of a header (and especially a title header): to give summary information about the presented information.
If your database structure is properly normalised, you wouldn't find this information in the meeting details, but in the parent table ("Meeting Details for Project ACME"); or, if it is a homogenous group of records, you would present the common criteria that brought you to find that group of records in the first place (e.g. "Meeting Details from November 2016", i.e. all records with a date between 11/01/2016 and 11/30/2016).
Any ideas on how I can restructure this to work?
Hard to tell because we don't know the relationships in your database, plus the script you show is somewhat opaque: What is the sub-script you're calling doing? How are the sorts defined, and to what purpose?
As I suggested in another thread: try to formulate the problem outside of database terms. Another tip: use the comment feature in your script to describe the logic in your script, and why you're doing what you're doing (unless it's really obvious).
You will help not only us to understand your script, but – even more – yourself. If you cannot explain to yourself what you're doing, chances are good you don't understand it (completely).
Thank you, I will take your advise.
So you have, what:
Projects --< Meetings --< Minutes
My first idea is that if you want to see a report of all minutes for a particular meeting, you'd create a report layout that's based on the Minutes table.
The header would include fields from the two parent tables, e.g. Project::name and/or Meeting::date, or Meeting::number, Minutes:: Attendees etc..
(This it what I meant by presenting summary information in the header; the only things that summarizes all these meetings are stored in the parent tables.)
And you're certainly right in wanting to use a title header: you don't need to repeat the attendee list etc. on every page. But I'd also use a regular header, so you have a nice quickinfo on every page - just project and meeting date.
The body would simply have the fields from the minutes, where maybe you would use a really large part to accommodate a large discussion field; set that to slide and also reduce the part size.
So your basic "Show Minutes of a Meeting" could require all of
Go to Related Record [ from: Minutes ; layout : MinutesReport ; matching only ; from current only ]
Sort Records [ by: Minutes::number ]
Enter Preview Mode
Adjust Window [ Resize to Fit ]
Once you've got this (or something like it) working, you can begin the process of fine-tuning.
Yes I am working on this, but still have the problem of not having the current meeting info. So, I have created a layout for the first page only, coming from the meetingdetail table, and the report which I have taken out the title header and now my script still works. so in the end the user will print off the cover page for the current meeting, then go to the minutes log, find the project number then hit the script button. thanks for getting my mind working in the solution direction