IStandardCubeDataset.SetCallback

Fore Syntax

SetCallback(Module: IMetabaseObjectDescriptor; ForeClass: String);

Fore.NET Syntax

SetCallback(Module: Prognoz.Platform.Interop.Metabase.IMetabaseObjectDescriptor; ForeClass: String);

Parameters

Module. Description of the unit, in which the class is implemented that implements methods of the ISQLCallback interface.

ForeClass. Name of the class used for handling data extraction query generation.

Description

The SetCallback method sets a handler of data extraction query generation for a data source.

Comments

Specify name of the class that implements methods of the ISQLCallback interface in the ForeClass parameter.

To reset the specified handler, set the Module parameter to Null, and the ForeClass to "".

Fore Example

Executing the example requires that the repository contains a standard cube with STD_CUBE identifier and a unit with the CUBE_CALLBACK identifier. The SQLCallback class is implemented in the unit. Add links to the Cubes and Metabase system assemblies.

Example of class code

Sub UserProc;
Var
    MB: IMetabase;
    Cube: IStandardCube;
    CubeDataset: IStandardCubeDataset;
Begin
    MB := MetabaseClass.Active;
    Cube := MB.ItemById(
"STD_CUBE").Edit As IStandardCube;
    CubeDataset := Cube.Destinations.Item(
0).Datasets.Item(0);
    CubeDataset.SetCallback(MB.ItemById(
"CUBE_CALLBACK"), "SQLCallback");
    (Cube 
As IMetabaseObject).Save;
End Sub UserProc;

On executing the example, the handler of query generation is set for the first cube data source.

Fore.NET Example

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

Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Metabase;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    Cube: IStandardCube;
    CubeDataset: IStandardCubeDataset;
Begin
    MB := Params.Metabase;
    Cube := MB.ItemById[
"STD_CUBE"].Edit() As IStandardCube;
    CubeDataset := Cube.Destinations.Item[
0].Datasets.Item[0];
    CubeDataset.SetCallback(MB.ItemById[
"CUBE_CALLBACK"], "SQLCallback");
    (Cube 
As IMetabaseObject).Save();
End Sub;

See also:

IStandardCubeDataset