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.