StateOptions: Integer;
StateOptions: integer;
The StateOptions property determines the additional state used on opening a regular report for view.
On setting StateOptions the setting of the IPrxReportOptions.NoRecalcOnOpen property is ignored and:
If the StateOptions = 1 value is set, it is considered that the Do not Calculate Report on Open checkbox is selected in regular report parameters.
If the StateOptions = 2 value is set, it is considered that the Do not Calculate Report on Open checkbox is not selected 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.
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: