IDataAreaCommentManager.AllComments

Syntax

AllComments(TabSheet: ITabSheet): IDataAreaComments;

Parameters

TabSheet. The sheet table, in which one should get comments for data cells.

Description

The AllComments property returns all comments for data cells in the specified table.

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;
    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;
        // Comment manager
        CommentManager := DataArea.CommentManager;
        Comments := CommentManager.AllComments(TSheet);
        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 all comments created for data cells.

See also:

IDataAreaCommentManager