2 Replies Latest reply on Aug 22, 2012 10:28 AM by karendweaver

    Trying to print Contact Information along with Portal Information


      I used to be able to do this in Crystal Reports but Trying to get the hang of FileMaker 12 Pro.


      I have a table with all of the contacts and another table where items are scheduled into a calendar that is actually linked to another FileMaker 12 program. I can see, add, and change the data in the calendar without issue. Here is my issue. I am trying to get my report to report all the contact information along with only one entry made in the Calendar for that contact. We hope to use the calendar to track when we go to the address of the contact.


      So far I can only get the report to only show the first calendar event made for that contact. I have not figured how to generate the report through a script that used the primary key of the calendar event within the portal. I hope someone will be able to help. I have spent hours trying to figure this out and digging through help sites. Thanks in advance!

        • 1. Re: Trying to print Contact Information along with Portal Information

          Set your report layout to be based on the calendar events table rather than your contacts table. Use a "go to related records" script step to isolate all of the calendar events for that contact.


          If you can avoid it, don't try to print portals. When creating a report, base the layout on the "lowest level" of data - in this case the calendar events.

          • 2. Re: Trying to print Contact Information along with Portal Information

            There are a couple ways to do this IF you only want to print ONE calendar entry.  As David said, you can print from the calendar events, but nornally you would choose that method if you wanted to print more than one calendar entry.  In your case, I might do it differently, depending on how much contact info you are printing vs how much calendar data.


            The old way (pre-FM12) would be to use a global field to create a temporary relationship to just the calendar entry you want to show.


            The new way - use the ExecuteSQL function to pull the data you want.  You could put it in a global field for printing, or you could even put it into a global variable  (my preference, to avoid adding extra fields to the database).  Definitely worth your while to learn this,


            Pseudo-code Example:  Set Variable $$calendarInfo [ExecuteSQL ( "SELECT calendarInfofields FROM calendarTable WHERE keyfieldfromcalendar = 123456 " )


            place a merge variable <<$$calendarInfo>> on the layout and go.


            Hope that helps.