Printing from Multiple Tables

General Information about upcoming products, upgrades, etc.
Posts: 11
Joined: Sun Nov 07, 2004 11:20 am
PostPosted: Mon Apr 04, 2005 6:13 am
I'm trying to find the best way of printing a list of CONTACTS info which would include the related records of ADDRESSES and NUMBERS.

I'm trying to stay away from printing portals, for all the obvious reasons, which seems to leave me with the option of exporting all the info from the 3 tables to a temporary table.

However, the script for accomplishing that seems like a nightmare -- whichever way I slice it.

Not to mention the layout issues on the printing table.

Does anyone have any experince dealing with this?

Thanks,

Michael Reade
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Mon Apr 04, 2005 10:01 am
Well if you only had one related table (say addresses) it would be easy, right... you'd print from the related table, putting the contact information in a summary part.

Two related tables makes this tricky as you've found. Aside from printing one portals, I'd take the simplest of the two related pieces (probably the phone numbers) and pull all the related phone number information for a given contact into a text field in the contact's record. (You'd use this text field just for printing). Then you can print from Addresses as usual.

You can build this text field using the Troi text plugin or with a creative use of the ValueListItems function.

Be sure to trap for instances where a contact has no record in addresses and make one anyway.

Hope that helps.
John Sindelar
SeedCode
Posts: 11
Joined: Sun Nov 07, 2004 11:20 am
PostPosted: Mon Apr 04, 2005 10:33 am
John,

Thanks for your reply. There is an issue about whether there might be more addresses than numbers for a contact, or the other way around.

On my way to work I thought of the following strategy (thank the always inspiring NY subways for that) :wink:

First of all, it would have to be a report rather than a link. Second, it would happen in a temporary file (in my case, I'll use a LABELS table). Here's what it would look like in pseudo code:

Code: Select all
Go to layout LABELS_Detail
Show all records
Delete all records
Go to layout CONTACTS_List
Go to Record/Request (first)
Loop
    Loop
       Go to Related Record (new window, CONTACTS_TO_ADDRESSES,
              show only related records)
       Set field ADDRESSES_ID (in Labels), ADDRESSES_ID (from
              Addresses) --- thereby creating a new record in LABELS
       Go to Record Request, next, exit after last
    End Loop
    Loop
       ... all over again for related NUMBERS
    End Loop
    Go to Record Request, next, exit after last
End Loop

Go to LABELS_CONTACT INFO
SORT, PREVIEW, PRINT..
Go to Layout, Original Layout


There are a couple of additional steps to pretify the whole thing.

Any thoughts?

Michael Reade

Saci Solutions
Posts: 46
Joined: Thu Aug 19, 2004 6:33 pm
Location: Minneapolis, MN
PostPosted: Mon Apr 04, 2005 3:14 pm
I like John's suggestion better. No deletion or looping required, and it's safer for multi-user environments.
Posts: 11
Joined: Sun Nov 07, 2004 11:20 am
PostPosted: Mon Apr 04, 2005 5:50 pm
OK, I'll try to give John's idea a shot... I'll keep you posted

Michael
Posts: 11
Joined: Sun Nov 07, 2004 11:20 am
PostPosted: Mon Apr 04, 2005 6:14 pm
Just to expand on John's idea... As I see it, one must loop through the CONTACTS table to pull all the related numbers and dump that info in a text field.

Then we must somehow go to all the related ADDRESSES of the found set of CONTACTS and print them (via a multi-lined text global field??? related to a text field identical to the number field???).

Ender, I'm not sure whether it's better in a multi-user enviroment, because in my scenario we are not creating or modifying any record on the 3 tables in question -- only records in the TEMP table.

The big problem with mine, as I see it, is that it is VERY CPU intensive.

Michael
Posts: 46
Joined: Thu Aug 19, 2004 6:33 pm
Location: Minneapolis, MN
PostPosted: Tue Apr 05, 2005 4:04 pm
Try the demo I've posted here:

http://forum.filemakerworld.com/viewtopic.php?p=17433
Posts: 11
Joined: Sun Nov 07, 2004 11:20 am
PostPosted: Tue Apr 05, 2005 6:34 pm
Very cool.

I was playing with your file a bit. There is definetely a simplicity that my way was lacking. You could also do both of these valuelist item calcs on the Contacts db, and avoid any danger on not having a related address. This way you can also avoid the subsumary layout part.

The only thing i'm grappling with now is how to have more control over the field formating.

Question: is there a tab special character one might use?

Thanks a lot for your help Ender. You too John.

All the best,

Michael Reade

Saci Solutions

Return to FileMaker Products (General)

Who is online

Users browsing this forum: No registered users and 2 guests

cron
(855) SEEDCODE
[email protected]
Follow us: