Print monthly events

Support for our integrated Contact Manager, Calendar, and Project Tracker.
Posts: 44
Joined: Sat Mar 13, 2010 11:48 am
PostPosted: Sun Aug 12, 2012 9:48 am
Hello, I’m working with the Calendar 5.3 version.
I need to print a list of the daily events, or weekly or monthly, that I’ve selected from the layout “Calendar”. This list (designed in a new layout) is set up to show more details than the calendar layout.
To get the found set on Event List to match the events shown in the calendar, my print script navigates to the “Source No 1” layout and calls the script "Write FileMaker Source to Variable". Then navigates back to my new layout and prints.
But here starts my problem: when I want to print daily or weekly events, the found set match that on the calendar; but when I print monthly events, the found set doesn’t match. For example, the found set of August 2012 includes some events of July and some events of September. Of course, I need to print only those events included in August.
Have you any solution to this bug?
Thanks
Damian
SeedCode Staff
SeedCode Staff
Posts: 98
Joined: Mon Aug 13, 2012 7:43 am
PostPosted: Mon Aug 13, 2012 7:57 am
Hi Damian,
The approach I would take would depend on if you are displaying the events to be printed using just a list on your layout or if you were displaying it using the same method we do in the calendar.

If you are displaying the events in a list I would simply navigate to your layout and perform a find based on the event dates. So you could use a simple date range in the date start field, for example "8/1/2012...8/31/2012". Then just print those results. The problem with this method would be if an event spanned from one month to another though, as you are just searching on the date start field. To improve this you could expand your search results to also include the range in the date end field too but if an event was long than a month you may miss an event. So I would only use this technique if your events are never longer than a month.

If you are displaying the events in a calendar view and you only want to display dates for the current month you will have to edit the global date fields that the calendar uses to determine which dates to display. These fields are "CalendarRows::DateRangeStartAutoGlob" and "CalendarRows::DateRangeEndAutoGlob". The reason why you are getting some dates outside of the month you are in is because the calendar displays those dates to fill out the month grid. So you will need to temporarily change the dates in those fields, then when you are done change them back.

I would suggest making a new script. In that script I would set 2 local variables, each one to the data that is in the date range global fields. Then set those fields to the exact date range you want. Run the "Write FileMaker Source to Variable" script that you are using now. To finish just set the date range fields back to what they were using the variables you made.

Hope that helps.

-Tanner
Posts: 44
Joined: Sat Mar 13, 2010 11:48 am
PostPosted: Tue Aug 14, 2012 3:07 am
Hi Tanner, thanks for your response.

I’m displaying the events to be printed using another method because I need to add further events details in a new list.

The simplest method (performing a find based on the event dates) isn’t useful for my purpose, because I’d want to print all the actives events in the current month. For example, when I’m printing the events of August, I need to show all events including some day of August, despite their start date or their end date were out of August.

I tried to edit the fields are "CalendarRows::DateRangeStartAutoGlob" and "CalendarRows::DateRangeEndAutoGlob", but I think this way isn’t a good solution, because the start date and the end date are always changing.

Now I’m making a new script but I don’t understand your suggestion, because the exact date range is like this: “all the events that have some days in the month selected”
it would be possible to solve this problem in the Calendar version 6.15, with the new ExecuteSQL function?

Thanks for your help.

Damian
SeedCode Staff
SeedCode Staff
Posts: 98
Joined: Mon Aug 13, 2012 7:43 am
PostPosted: Tue Aug 14, 2012 8:19 pm
I might have been over complicating things here. To cover all scenarios with dates we will basically need 3 find requests. One that checks if a start date is in a given month. So in your start date field you would find "8/1/2012...8/31/2012". Then another find request for the end date. So in your end date field you would put the same thing "8/1/2012...8/31/2012". Then a third that would check for before the first start date and after the end date. So in the start date field you would find "<8/1/2012" and in your end date field ">8/31/2012".

Check out the attached screenshot for a very simple version of this script. Let me know if it is unclear.

FindMonthEvents2.png
FindMonthEvents2.png (66 KiB) Viewed 11747 times


Thanks,

Tanner
Posts: 44
Joined: Sat Mar 13, 2010 11:48 am
PostPosted: Wed Aug 15, 2012 12:38 am
Thank you, Tanner:
I've just tried the script but doesn't work correctly.
Instead I found a simple way (perhaps rather rudimentary) that works perfectly:

In Source no1 layout I've created a calculation field that shows the year and the months of the event. For example if the month of start date is June and the final month is August, I can see: June, July, August and the year.

I've created a new script modifying the "Write Filmekaker Source to Variable" script.
To print an event monthly list, first I set a local variable with the month name and the year. I set the new field with the variable and perform find.
Then I'm going to my event list and I can print.

Thank you very much for your help!!

Dunumba
SeedCode Staff
SeedCode Staff
Posts: 98
Joined: Mon Aug 13, 2012 7:43 am
PostPosted: Wed Aug 15, 2012 6:43 am
There is always more than one way to get something done in Filemaker. That's why I love it so much :-)

Great to hear that you got a working solution. Great job!

Return to SeedCode Calendar

Who is online

Users browsing this forum: No registered users and 2 guests

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