IMetabaseObjectDescriptor.OpenWithParam

Syntax

OpenWithParam(Values: Variant): IMetabaseObjectInstance;

OpenWithParam(Values: Object): Prognoz.Platform.Interop.Metabase.IMetabaseObjectInstance;

Parameters

Values. Value of the parameter, which is used on opening the object.

Description

The OpenWithParam method opens the object and returns its data.

Comments

It is relevant to use this method if the object has one parameter.

Example

Executing the example requires that the repository contains a query with the Query_1 identifier. This query was created with one parameter.

Add links to the Db and Metabase system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    MObj: IMetabaseObjectDescriptor;
    Inst: IDatasetInstance;
    Fields: IDatasetInstanceFields;
Begin
    MB := MetabaseClass.Active;
    MObj := MB.ItemById(
"Query_1");
    Inst := MObj.OpenWithParam(
100As IDatasetInstance;
    Fields := Inst.Fields;
    
While Not Inst.Eof Do
        Debug.WriteLine(Fields.Item(
0).Value);
        Inst.Next;
    
End While;
End Sub UserProc;
Imports Prognoz.Platform.Interop.Db;
Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    MObj: IMetabaseObjectDescriptor;
    Inst: IDatasetInstance;
    Fields: IDatasetInstanceFields;
Begin
    MB := Params.Metabase;
    MObj := MB.ItemById[
"Query_1"];
    Inst := MObj.OpenWithParam(
100As IDatasetInstance;
    Fields := Inst.Fields;
    
While Not Inst.Eof() Do
        System.Diagnostics.Debug.WriteLine(Fields.Item[
0].Value);
        Inst.Next();
    
End While;
End Sub;

The query with the specified value of parameter is opened after executing this example. Values of the first data column received while execution of the query are displayed in the development environment console.

See also:

IMetabaseObjectDescriptor