DIAdem Help

Property: ChannelNumberIn for TransformDataContextX

  • Updated2024-09-12
  • 2 minute(s) read

Property: ChannelNumberIn for TransformDataContextX

Specifies the number of the input channel for the channel transformation in a 2D table in DIAdem REPORT.

Object.ChannelNumberIn
ObjectTransformDataContextX
Object with this property
Object.ChannelNumberInLongInteger with read access
As VBS cannot process the large returned numeric values, you must first assign this value to a DIAdem variable, such as R1, in order to use it in VBS expressions.
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 2D table with two columns, specifies the column properties, and assigns the MyOnChannelTransformation user command to the second column:

Dim oMy2DTable, oMyColumn, oMyColumnTrans
Call Report.NewLayout()
Set oMy2DTable = Report.ActiveSheet.Objects.Add(eReportObject2DTable,"My2DTable")
oMy2DTable.Position.ByBorder.Top = 30
oMy2DTable.Position.ByBorder.Bottom = 20
oMy2DTable.Position.ByBorder.Left = 20
oMy2DTable.Position.ByBorder.Right = 30
Set oMyColumn = oMy2DTable.Columns.Add(e2DTableColumnChannel)
oMyColumn.Channel.Reference = "[1]/[2]"
Set oMyColumnTrans = oMy2DTable.Columns.Add(e2DTableColumnChannel)
oMyColumnTrans.Channel.Reference = "[1]/[2]"
oMy2DTable.Settings.UseChannelTransformation = True
oMyColumnTrans.OnChannelTransformation = "MyOnChannelTransformation"
Call Report.Refresh()

The user command summates all values in the columns and returns the results in the second column:

Sub MyOnChannelTransformation(TransformContext)
  Dim oMyDataContext
  Set oMyDataContext = TransformContext.DataContext
  Call ChnSum(oMyDataContext.ChannelNumberIn, oMyDataContext.ChannelNumberOut) 'Calculates the sum of the channel values
End Sub

Log in to get a better experience