IsEmptySelection: Boolean;
IsEmptySelection(): boolean;
The IsEmptySelection method returns whether the selection of cube dimension elements is set.
Available values:
True. The elements selection is not set.
False. The elements selection is set.
Executing the example requires that the repository contains a mobile application with the MA_PUB identifier. Add links to the Metabase, Mobile, Dimensions system assemblies.
Sub Main;
Var
mb: IMetabase;
Mobile: IMobileApplication;
Publicator: IMobileApplicationPublicator;
MaPubObs: IMobileApplicationPublishObjects;
i: Integer;
MaPubObj: IMobileApplicationPublishObject;
PubObj: IMobilePublishObject;
CubePubObj: IMobilePublishCube;
s: String;
SelSet: IDimSelectionSet;
DimSel: IDimSelection;
j: Integer;
Begin
mb := MetabaseClass.Active;
// Get mobile application
Mobile := mb.ItemById("MA_PUB").Bind As IMobileApplication;
// Create a mobile application publisher
Publicator := Mobile.CreatePublicator;
//Get mobile application objects
MaPubObs := Publicator.Items;
For i := 0 To MaPubObs.Count - 1 Do
MaPubObj := MaPubObs.Item(i);
//Select cubes in the objects
If MaPubObj.Type = MobilePublishObjectType.Cube Then
PubObj := MaPubObj.PublishObject;
CubePubObj := PubObj As IMobilePublishCube;
//Display data about the cube to the console window
s := PubObj.Object.Name + "(" + PubObj.Object.Id + ")";
Debug.WriteLine("Cube:" + s);
//Set the method of data export
Debug.Write("Method of data export: ");
CubePubObj.PortionalLoad := True;
Debug.WriteLine("requests all data by the blocks of 1 million elements each");
//Check whether selection is set
If CubePubObj.IsEmptySelection Then
// If the selection is not set
// Select all elements
CubePubObj.SelectAll;
Else
//If the selection is set
//Load selection and display it in the console window
SelSet := CubePubObj.LoadSelection;
For j := 0 To SelSet.Count - 1 Do
DimSel := SelSet.Item(j);
s := DimSel.Dimension.Name;
Debug.WriteLine("- dimension:" + s);
Debug.WriteLine("-selection:");
Debug.Indent;
Debug.WriteLine(DimSel.ToString);
Debug.Unindent;
Debug.WriteLine("");
End For;
End If;
End If;
End For;
End Sub Main;
Example execution result: the console window displays information on the selection of the cube dimension elements from the mobile application and the method of data export.
Executing the example requires that the repository contains a mobile application with the MA_PUB identifier.
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Mobile;
Imports Prognoz.Platform.Interop.Dimensions;
…
Public Shared Sub Main(Params: StartParams);
Var
mb: IMetabase;
Mobile: IMobileApplication;
Publicator: IMobileApplicationPublicator;
MaPubObs: IMobileApplicationPublishObjects;
i: Integer;
MaPubObj: IMobileApplicationPublishObject;
PubObj: IMobilePublishObject;
CubePubObj: IMobilePublishCube;
s: String;
SelSet: IDimSelectionSet;
DimSel: IDimSelection;
j: Integer;
Begin
mb := Params.Metabase; ;
// Get mobile application
Mobile := mb.ItemById["MA_PUB"].Bind() As IMobileApplication;
// Create a mobile application publisher
Publicator := Mobile.CreatePublicator();
//Get mobile application objects
MaPubObs := Publicator.Items;
For i := 0 To MaPubObs.Count - 1 Do
MaPubObj := MaPubObs.Item[i];
//Select cubes among the objects
If MaPubObj.Type = MobilePublishObjectType.mpotCube Then
PubObj := MaPubObj.PublishObject;
CubePubObj := PubObj As IMobilePublishCube;
//Display data about the cube in the console window
s := PubObj.Object.Name + "(" + PubObj.Object.Id + ")";
System.Diagnostics.Debug.WriteLine("Cube:" + s);
//Set method of data export
System.Diagnostics.Debug.Write("Method of data export: ");
CubePubObj.PortionalLoad := True;
System.Diagnostics.Debug.WriteLine("requests all data by the blocks of 1 million elements each");
//Check if selection is set
If CubePubObj.IsEmptySelection() Then
// If selection is not set
// Select all elements
CubePubObj.SelectAll();
Else
//If the selection is set
//Load selection and display it in the console window
SelSet := CubePubObj.LoadSelection();
For j := 0 To SelSet.Count - 1 Do
DimSel := SelSet.Item[j];
s := DimSel.Dimension.Name;
System.Diagnostics.Debug.WriteLine("- dimension:" + s);
System.Diagnostics.Debug.WriteLine("-selection:");
System.Diagnostics.Debug.Indent();
System.Diagnostics.Debug.WriteLine(DimSel.ToString("", ",", False));
System.Diagnostics.Debug.Unindent();
System.Diagnostics.Debug.WriteLine("");
End For;
End If;
End If;
End For;
End Sub;
Example execution result: the console window displays information on the selection of the cube dimension elements from the mobile application and the method of data export.
See also: