IPivot.CalculateDataRights

Syntax

CalculateDataRights: Boolean;

CalculateDataRights: boolean;

Description

The CalculateDataRights property determines whether user access permissions to table cells will be calculated.

Comments

Available values:

The property is relevant to build table using the IPivot.ObtainTable method. If for users there is an access permissions restrictions for table cells, then on calculating access permissions, it will be available to determine operations with table cells for a specific user using the CubeDataRights enumeration.

For detailed information about user access permissions to table cells, see theDisplaying data access permissions as icons. section.

Example

Executing the example requires a form with the Button component named Button1, the TabSheetBox component named TabSheetBox1 and the UiErAnalyzer component named UiErAnalyzer1 which is a data source for TabSheetBox (for Fore.NET example use the TabSheetBoxNet component named TabSheetBoxNet1 and the UiErAnalyzerNet component named uiErAnalyzerNet1). An express report should be loaded to UiErAnalyzer1. The user must get read-only permissions to the first table cell.

Add links to the system assemblies:

The example will be executed on clicking the button implemented by the Button component named Button1.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var 
    EaxAn: IEaxAnalyzer;
    Pivot: IPivot;
    Table: IPivotTable;
Begin
    
//Activate the component to get data access
    UiErAnalyzer1.Active:= True;
    
//Determine express report connected to the component
    EaxAn := UiErAnalyzer1.ErAnalyzer;
    Pivot := EaxAn.Pivot;
    
//Determine whether it is necessary to calculate access permissions to data
    Pivot.CalculateDataRights := True;
    
//Create a table, calculate user access permissions to cells
    Table := Pivot.ObtainTable;
    
//Check user access permissions to the first table cell
    //If user has read-only permissions, the appropriate message will be displayed
    If Table.DataRights(00) = CubeDataRights.Read Then
       WinApplication.InformationBox(
"The first table cell is read-only");
    
End If;
End Sub Button1OnClick;

Imports System.Windows.Forms;
Imports Prognoz.Platform.Forms.Net;
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Pivot;
Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Ui;
Imports Prognoz.Platform.Interop.Tab;

Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var 
    EaxAn: IEaxAnalyzer;
    Pivot: IPivot;
    Table: IPivotTable;
    WinAppCls: WinApplicationClass = 
New WinApplicationClassClass();
Begin
    
//Activate the component to get data access
    UiErAnalyzerNet1.Active:= True;
    
//Determine express report connected to the component
    EaxAn := UiErAnalyzerNet1.ErAnalyzer.ErAnalyzer;
    Pivot := EaxAn.Pivot;
    
//Determine whether it is necessary to calculate access permissions to data
    Pivot.CalculateDataRights := True;
    
//Create a table, calculate user access permissions to cells
    Table := Pivot.ObtainTable();
    
//Check user access permissions to the first table cell
    //If user has read-only permissions, the appropriate message will be displayed
    If Table.DataRights[00] = CubeDataRights.cubdatrigRead Then
        WinAppCls.InformationBox(
"The first table cell is read-only"New IWin32WindowForeAdapter(Self));
    
End If;        
End Sub;

After executing the example the form will display data table, the dialog box containing message about access permissions to the first table cell opens:

See also:

IPivot | IPivot.ObtainTable | CubeDataRights