IMetabaseObjectParamValuesEx.StateOptions

Fore Syntax

StateOptions: Integer;

Fore.NET Syntax

StateOptions: integer;

Description

The StateOptions property determines the additional state used on opening a regular report for view.

Comments

On setting StateOptions the setting of the IPrxReportOptions.NoRecalcOnOpen property is ignored and:

Fore Example

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.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Report;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    MBobj : IMetabaseObjectDescriptor;
    Param : IMetabaseObjectParamValues;
    ParamEx : IMetabaseObjectParamValuesEx; 
    Report: IPrxReport;
    Recalc: Boolean;
Begin
    MB := Params.Metabase;
    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;

See also:

IMetabaseObjectParamValuesEx