User input of report filter

Given a report, what is the best way to allow the end-user to input a particular year as a filter?

Basically, you need to open a window to prompt the user for a value.
The People.app example application has one example in one if its reports.

Create a Window procedure to collect the filter criteria. Have a Print Button calls the Report. Always have a Cancel button. I think the ABC report template has a way to put the window in the report procedure so variables are local. The external window could run one of several reports using the same criteria.

If the window is external then the problem is how to get the criteria variables to the Report. Passing them as parameters is probably cleanest accepted coding style.

If the Window and Report are in the same Module you can define Module variables. Some will frown on that but it is easy to code.

The module values are static, unless threaded, so if run again they will already be filled in, until the program’s closed. You could preserve the users last criteria in the registry or INI. It’s nice when you realize you had one thing wrong to not have to redo all criteria.

Thanks for the answers. These have been very helpful.
The PEOPLE example demonstrated that the filter may be chosen from the progress window with a pause button extension.

Be careful with the pause button and filters. I seem to recall having to do something to make the filter work other than just set some variables because the VIEW is open at that point.
Call an ABC SetFilter and ApplyFilter perhaps?

One more option - have a Window procedure return a group or set a passed group.

I have a pane on the right side of my browse list. I have a SHEET control on the pane.
The first tab on the sheet is Information. It shows the fields of the selected row. This is quite useful when one of the fields is a long STRING field; I can put this in a read-only TEXT control or a multi-line PROMPT control.
Another tab is for Selection options, where the user can select a Year or a Date range, or lots of other selection options.
Another tab is for Reports. So the user can input the particular Year (and other options) as a filter for the report and then select one of the reports.
One nice benefit is, the browse list can use the same filter (and sorting), so the reports are wysiwyg.