Editing Report with Parameter Value Type Check

Parameters take values of various types. On opening a report with the Dictionary Box Editor parameter display type from Fore check parameter value type to work with value of controls. The drop-down list of the control allows for single and multiple selection. An error may occur due to inaccurate number of selected elements and mismatching data types.

Consider an example of opening a regular report for edit including check of parameter value type as an array.

Executing the example requires a regular report where the object parameter with the ITEM identifier and the dictionary box editor is added. Create an event handler in the Fore unit. Add the parameter value type check for the OnBeforeOpenReport event occurring before the regular report opening. Add links to the Metabase, Report system assemblies.

Public Sub OnBeforeOpenReport(Report: IPrxReport; Var Cancel: Boolean);
Var
    Rep: IMetabaseObjectInstance;
    Value: IMetabaseObjectParamValue;
Begin
    Rep := Report.MetabaseObjectInstance;
    If Rep <> Null Then
       Value := Rep.ParamValues.FindById("ITEM");
       (Report.ActiveSheet As IPrxTable).TabSheet.CellValue(00) := Value.IsArray ? "ARRAY!" : Value.Value;
    End If;
End Sub OnBeforeOpenReport;

After executing the example, on opening the regular report, the dialog box prompting to select parameter from the list of the specified dictionary is displayed:

The selected parameter value is displayed in the first cell of the regular report.

See also:

Examples