I do something similar with the next two months worth of event records. I just FIND and then print.
You can script the Find by setting the field to
Get (Currentdate) & "..." & Get(CurrentDate) + 4
Enter Find mode
Set field (date ; <<use above calc>> )
Sort (by date field)
Assuming you are on the first record of the set of five you want, I'd do something like this:
set variable [ $i ; 5 // set to number of records you want to show]
show all records
exit loop if [ $i = 0 ]
set variable [ $i ; $i - 1 ]
For extra credit, put the number of records to print in a script parameter.
Super, thank you. How would I modify that to print from the date of the record I'm in rather than current date?
instead of "Get (CurrentDate)" use the date field of the current record.
You might consider passing the "start date" to the script as a parameter.
You can keep your found set by going to a layout where you have a portal to a self relationship, sorted by date and with a filter defined as ≥ RecordDate, this being the name of the field that holds the record date.
The portal will be set to show only 5 lines and will be sized so that it's as big as the paper you're printing on.
Inside each portal line (which are quite big) you should be able to fit lots of data.
The print script will have the "print current record only" option set. The whole print script is merely 1. go to portal layout, 2. print, 3. go to original layout. No finds, no landing on a different record, works from any initial record you are on.
Of course if what you want is to print each record on a different page, then it needs extra work.
Thank you everyone for all the input and helping out a newb like myself. I'm sure all solutions were correct and I wish I could give everyone the "correct" answer button but ultimately I based the script off of everyman's first post. Thanks again.
Don't worry, here on this forum "correct" means "maximized my happiness", because it solved the problem, was easy to implement, I understood what I was doing and there was no noticeable impact on overall performance