How do I set the initial values of parameters for the parameter form at runtime?
This is what the BeforeForm trigger is primarily used for. Even if you have used a select statement to create a lookup list for the parameter, this statement is fully parsed before the parameter form is opened. Simply setting the parameter to a given value in the BeforeForm trigger will select that option as the default value displayed to the user. For example, assume you have a parameter called p_input_date which is intended to hold an invoice date. The following example will select the most recent invoice date as the default, and note that it properly handles exceptions to ensure that the report does not arbitrarily die if this default setting fails. Note also that like all report triggers, it must return a true or false value.
Related Questions
- Can I pass parameter values to my reports directly from a link or my own application, without using the parameter form that ReCrystallize Pro creates?
- How can I change the starting values for Optimization or Parameter Estimation parameters, when I am stuck in a local minimum?
- Do initial parameter values matter?