IPivotTable.PostEx

Fore Syntax

PostEx(Excluded: IDimSelectionSet; [Callback: ICubeCallback = Null]);

Fore.NET Syntax

PostEx(Excluded: Prognoz.Platform.Interop.Dimensions.IDimSelectionSet; [Callback: Prognoz.Platform.Interop.Cubes.ICubeCallback = Null]);

Parameters

Excluded.Selection of elements, which dimensions will not be saved.

Callback. Object that handles errors that may occur on saving data.

Description

The PostEx method cancels the edit mode and saves modified table data with ability to specify the data that will not be saved.

Comments

The method saves modified data by all elements, except for those, which are included into the Excluded selection. This method is relevant to use if there are modified data by calculated elements, because data by these elements cannot be saved. To get information about presence of this data by calculated elements, use the IsDataChanged property.

Fore Example

Executing the example requires a form with the Button1 button, the UiErAnalyzer component named UiErAnalyzer1 and any visualizers showing data or express report connected to UiErAnalyzer1. Express report is opened in the edit mode (the IEaxAnalyzer.EnableEdit property is set to True). Add the Express, Dimensions and Pivot system assemblies to the form.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Eax: IEaxAnalyzer;
    PTable: IPivotTable;
    DimSS: IDimSelectionSet;
    DimS: IDimSelection;
Begin
    Eax := UiErAnalyzer1.Instance As IEaxAnalyzer;
    //Get selection by calculated elements
    DimSS := Eax.DataArea.Hierarchies.AddedElementsSelection(Eax.Grid.Slice);
    PTable := Eax.Pivot.ObtainTable;
    //If there are no modified data by calculated elements, use the Post method for saving
    //If there are modified data, use PostEx to save all changes except for those by calculated elements
    If Not PTable.IsDataChanged(DimSS) Then
        PTable.Post;
    Else
        PTable.PostEx(DimSS);
    End If;
End Sub Button1OnClick;

Clicking the button checks presence of all modified data by calculated elements. If there are no changes for these elements, use the Post method to escape the edit mode, in other cases use the PostEx method.

Fore.NET Example

Executing the example requires a form with the Button1 button, the UiErAnalyzer component named UiErAnalyzer1 and any visualizers showing data or express report connected to UiErAnalyzer1. Express report is opened in the edit mode (the IEaxAnalyzer.EnableEdit property is set to True). Add the Express, Dimensions and Pivot system assemblies to the form.

Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Pivot;

Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
    Eax: IEaxAnalyzer;
    PTable: IPivotTable;
    DimSS: IDimSelectionSet;
    DimS: IDimSelection;
Begin
    Eax := UiErAnalyzerNet1.AnalyzerUi.Instance As IEaxAnalyzer;
    //Get selection by calculated elements
    DimSS := Eax.DataArea.Hierarchies.AddedElementsSelection[Eax.Grid.Slice];
    PTable := Eax.Pivot.ObtainTable();
    //If there are no modified data by calculated elements, use the Post method for saving
    //If there are modified data, use PostEx
    If Not PTable.IsDataChanged[DimSS] Then
        PTable.Post(Null);
    Else
        PTable.PostEx(DimSS, Null);
    End If;
End Sub;

Clicking the button checks presence of all modified data by calculated elements. If there are no changes for these elements, use the Post method to escape the edit mode, in other cases use the PostEx method.

See also:

IPivotTable