PostEx(Excluded: IDimSelectionSet; [Callback: ICubeCallback = Null]);
Excluded. Selection of elements, changes on which will not be saved.
Callback. Object that handles errors that may occur on saving data.
The PostEx method exits the edit mode and saves changed table data with the ability to specify the data that will not be saved.
The method saves changed data by all elements, except for those, which are included into the Excluded selection. This method is relevant if there is changed 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.
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 links to 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 is no changed data by calculated elements, use the Post method for saving
//If there is changed 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 changed data by calculated elements. If there are no changes for these elements, use the Post method to exit the edit mode, in other cases use the PostEx method.
See also: