StateOptions: Integer;
The StateOptions property determines the additional state used on opening a regular report for view.
When StateOptions is set, setting of the IPrxReportOptions.NoRecalcOnOpen property is ignored and:
If StateOptions = 1, it is considered that the Do not Calculate Report on Open checkbox is selected in regular report parameters.
If StateOptions = 2, it is considered that the Do not Calculate Report on Open checkbox is deselected in regular report parameters.
Executing the example requires a regular report with the REGULAR_REPORT identifier.
Add links to the Metabase and Report system assemblies.
Sub UserProc;
Var
MB: IMetabase;
MBobj : IMetabaseObjectDescriptor;
Param : IMetabaseObjectParamValues;
ParamEx : IMetabaseObjectParamValuesEx;
Report: IPrxReport;
Recalc: Boolean;
Begin
MB := MetabaseClass.Active;
MBobj := MB.ItemById("REGULAR_REPORT").Bind;
Param := MBobj.Params.CreateEmptyValues;
Param.Item(0).Value := DateTime.Today;
ParamEx := Param As IMetabaseObjectParamValuesEx;
Report := MBobj.Open(Param) As IPrxReport;
Recalc := Report.Options.NoRecalcOnOpen;
If Recalc Then
ParamEx.StateOptions := 2;
Else
ParamEx.StateOptions := 1;
End If;
End Sub UserProc;
After executing the example it is checked if there is the value set in the IPrxReportOptions.NoRecalcOnOpen property. The value of the StateOptions property is set depending on this value.
See also: