Laner: ILaner;
Laner: Prognoz.Platform.Interop.Laner.ILaner;
The Laner property returns an object used to set up workbook.
To get the object for workbook setup, one can also use the IEaxAnalyzerCore.Laner property.
Executing the example requires that the repository contains a folder with the WORKBOOKS identifier and a time series database with the TSDB identifier.
Add links to the Cubes, Express, Laner and Metabase system assemblies.
Sub UserProc;
Var
MB: IMetabase;
CrInfo: IMetabaseObjectCreateInfo;
MObj: IMetabaseObject;
Exp: IEaxAnalyzer;
Source: IMetabaseObjectDescriptor;
WB: IEaxWorkbook;
Context: ILanerContext;
Laner: ILaner;
Begin
// Get repository
MB := MetabaseClass.Active;
// Set basic parameters of creating a workbook
CrInfo := MB.CreateCreateInfo;
CrInfo.ClassID := MetabaseObjectClass.KE_CLASS_WORKBOOK;
CrInfo.Id := MB.GenerateId("NEW_WORKBOOK");
CrInfo.Name := "New workbook";
CrInfo.Parent := MB.ItemById("WORKBOOKS");
// Create the "Workbook" repository object
MObj := MB.CreateObject(CrInfo).Edit;
Exp := MObj As IEaxAnalyzer;
WB := Exp As IEaxWorkbook;
// Set a workbook data source
Source := MB.ItemById("TSDB");
Laner := WB.Laner;
Laner.RubricatorInstance := Source.Open(Null) As IRubricatorInstance;
// Set up context
WB.UseLanerContext := True;
Context := WB.LanerContext;
Context.AllowExternalStubs := True;
Context.AllowSmartHighlighting := True;
Context.AllowSynchronization := True;
//Save the created repository object
MObj.Save;
End Sub UserProc;
After executing the example the WORKBOOKS folder will contain a created workbook with configured context. A time series database with the TSDB identifier will be used as a data source.
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.Express;
Imports Prognoz.Platform.Interop.Laner;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
CrInfo: IMetabaseObjectCreateInfo;
MObj: IMetabaseObject;
Exp: IEaxAnalyzer;
Source: IMetabaseObjectDescriptor;
WB: IEaxWorkbook;
Context: ILanerContext;
Laner: ILaner;
Begin
// Get repository
MB := Params.Metabase;
// Set basic parameters of creating a workbook
CrInfo := MB.CreateCreateInfo();
CrInfo.ClassID := MetabaseObjectClass.KE_CLASS_WORKBOOK As integer;
CrInfo.Id := MB.GenerateId("NEW_WORKBOOK", 0);
CrInfo.Name := "New workbook";
CrInfo.Parent := MB.ItemById["WORKBOOKS"];
// Create the "Workbook" repository object
MObj := MB.CreateObject(CrInfo).Edit();
Exp := MObj As IEaxAnalyzer;
WB := Exp As IEaxWorkbook;
// Set a workbook data source
Source := MB.ItemById["TSDB"];
Laner := WB.Laner;
Laner.RubricatorInstance := Source.Open(Null) As IRubricatorInstance;
// Set up context
WB.UseLanerContext := True;
Context := WB.LanerContext;
Context.AllowExternalStubs := True;
Context.AllowSmartHighlighting := True;
Context.AllowSynchronization := True;
//Save the created repository object
MObj.Save();
End Sub;
See also: