Object: 2DTableDrawingCell

DIAdem 2018 Help

Edition Date: June 2018
Part Number: 370858P-01
View Product Info

DOWNLOAD (Windows Only)

DIAdem 2015 Help
DIAdem 2017 Help
DIAdem 2018 Help
DIAdem 2019 Help
DIAdem 2020 Help

The 2DTableDrawingCell object provides information about the cell DIAdem is plotting in a 2D table in DIAdem REPORT.

Note  To test the example script, you must first save the second script and register it as a user command in the dialog box that opens when you select Settings»Extensions»User Commands.

The following example generates a table with two columns and assigns the MyOnDrawingCell user command to the cells in the first column:

Dim oMy2DTable, oMyPosition, oMyColumn1, oMyColumn2
Call Report.NewLayout()
Set oMy2DTable = Report.ActiveSheet.Objects.Add(eReportObject2DTable,"My2DTable")
Set oMyPosition = oMy2DTable.Position.ByBorder
oMyPosition.Top = 30
oMyPosition.Bottom = 20
oMyPosition.Left = 20
oMyPosition.Right = 30
Set oMyColumn1 = oMy2DTable.Columns.Add(e2DTableColumnChannel)
oMyColumn1.Channel.Reference = "[1]/[1]"
Set oMyColumn2 = oMy2DTable.Columns.Add(e2DTableColumnChannel)
oMyColumn2.Channel.Reference = "[1]/[2]"
oMy2DTable.Settings.IndexSettings.IndexMode = e2DTableIndexModeAutomaticallyIncreasing
oMyColumn1.Settings.OnDrawingCell = "MyOnDrawingCell"

The user command changes the display and the contents of the cells being plotted. The user command receives two parameters. The first parameter corresponds to a 2DTableDrawingCellContext object and provides information about the table, the column, the cell, and the worksheet in which DIAdem is plotting the cell. The second parameter corresponds to a 2DTableDrawingCell object and provides information about the cell DIAdem is plotting:

Sub MyOnDrawingCell(Context, Cell)
  If (Context.Table.Name = "My2DTable")  Then
    Cell.Font.Color.SetRGBColor(RGB(255, 128, 128))
    If Context.Row = 1 Then
      Cell.Value = Cell.Value & " Sheet: " & Context.Sheet.Name
      Cell.Value = Cell.Value & " Col: " & Context.Col & "; Row: " & Context.Row  & "; Rel. row: " & Context.RelativeRow 
    End If
  End If
End Sub


Angle | BackgroundColor | Font | Value


Not Helpful