IDataAreaCommentManager.Comments

Syntax

Comments(TabSheet: ITabSheet; Row: Integer; Column: Integer): IDataAreaComments;

Parameters

TabSheet. Sheet table, which contains a data cell.

Row. Index of data cell row.

Column. Index of data cell column.

Description

The Comments property returns comments for a cell with the specified coordinates.

Comments

The specified coordinates should correspond to the cell in the data cell range of any slice. The data range can be obtained using the IEaxGrid.SpecificRange property with the EaxRangeType.Internal parameter. To check if work with comments is available, use the IEaxDataAreaSource.HasCommentsSupport property.

Example

Executing the example requires that the repository contains a regular report with the REPORT identifier. The report has a standard cube as a data source, in which storing of comments for data cells is enabled. A slice and a table visualizer are created based on the data source.

Add links to the Express, Metabase, Report, Tab system assemblies.

Sub UserProc;
Var
    Mb: IMetabase;
    Report: IPrxReport;
    DataArea: IEaxDataArea;
    Slice: IEaxDataAreaSlice;
    Grid: IEaxGrid;
    TSheet: ITabSheet;
    DataRange: ITabRange;
    CommentManager: IDataAreaCommentManager;
    Comments: IDataAreaComments;
    Comment: IDataAreaComment;
    i, j: Integer;
Begin
    Mb := MetabaseClass.Active;
    Report := Mb.ItemById("REPORT").Open(NullAs IPrxReport;
    // Analytical data area
    DataArea := Report.DataArea;
    Slice := DataArea.Slices.Item(0);
    If Slice.Source.HasCommentsSupport Then
        Grid := Slice.Views.Item(0as IEaxGrid;
        TSheet := Grid.TabSheet;
        DataRange := Grid.SpecificRange(EaxRangeType.Internal);
        // Comment manager
        CommentManager := DataArea.CommentManager;
        Comments := CommentManager.Comments(TSheet, DataRange.Top, DataRange.Left);
        For Each Comment In Comments Do
            Debug.WriteLine(Comment.Text);
            Debug.Indent;
            Debug.WriteLine("Key: " + Comment.Key.ToString + ". Created: " + Comment.TimeStamp.ToString + ' ' + Comment.User + ". Permissions: " + Comment.Rights);
            Debug.Write("Coords: ");
            j := Comment.Coords.Length;
            For i := 0 To j - 1 Step 2 Do
                Debug.Write("[Row: " + Comment.Coords[i].ToString + ", Column: " + Comment.Coords[i + 1].ToString + ']');
            End For;
            Debug.WriteLine("");
            Debug.Unindent;
            Debug.WriteLine("----------");
        End For;
    End If;
End Sub UserProc;

After executing the example the development environment console displays information about the comments created for the first data cell in the analytical data area slice.

See also:

IDataAreaCommentManager