The parameter dialog mechanism provides a way to prompt the user for parameter values, and to supply default values.
First, it is neccessary to set up a set of parameter prompts. There should be one for each parameter that is used in the form or report, each containing the parameter name (as in ${name}), the default value, and some prompt text. To set these up, open the document in design view, and go to the document properties dialog; here, locate and double-click the paramaters item.
This will show the properties dialog in the form shown below; the screenshot shows one parameter from_date already set up, and the other to_date being edited. Also shown here is the use of scripting to provide a default range of dates from the first of the current month to the first of the next month ( Actually, the code isn't quite right. It gets the first of the next month by adding 31 days (in seconds) to the current time, which might of course be the month after next. Completely correct code is left as an exercise for the reader. ) ; the usage is just the same as for using an expression as the value of a field in a report or a form. Note that for this example to work, the report must import the python time module.
There are two further settings associated with each paramater. The first, Format serves two purposes, to verify the entered parameter, and to format the entered value. Formats are set using the button to the right of the format field, which brings up the same dialog as is used when setting formats on (for examples) fields in forms and reports. In this screenshot, the format is for a date as dd-mmm-yy (like 12-Apr-03).
The other setting is Prompt. This is only relevant when the form or report is opened using the script function openForm() (or openReport()), as described below. by default, if a value for the paramater is passed via the openForm() function, then that parameter is not shown in the dialog to the user; however, if Prompt is set, then the user is always prompted for the paramater (and the dialog shows the value passed via openForm() rather than the default set in the paramater dialog).