Hello,
I want to format a table using script. For now, I just add some columns, set position, and apply a usercommand to color a column by text.
But in the next steps, I need to set width for each column, size of text for each column, add separator between rows, bold some columns but I no have ideea. Could you help me please?
'Variables
dim oTable, oCol1, oCol2, oCol3, oCol4, oCol5, oCol6, oCol7
'Objects
Set oTable = report.Sheets(4).Objects.Add(eReportObject2DTable,"")
Set oCol1 = oTable.Columns.Add(e2DTableColumnChannel)
Set oCol2 = oTable.Columns.Add(e2DTableColumnChannel)
Set oCol3 = oTable.Columns.Add(e2DTableColumnChannel)
Set oCol4 = oTable.Columns.Add(e2DTableColumnChannel)
Set oCol5 = oTable.Columns.Add(e2DTableColumnChannel)
Set oCol6 = oTable.Columns.Add(e2DTableColumnChannel)
Set oCol7 = oTable.Columns.Add(e2DTableColumnChannel)
'Add Channel in table
oCol1.Channel.Reference = Data.Root.ChannelGroups("TestResults").Channels("Testname").GetReference(eRefTypeIndexIndex)
oCol2.Channel.Reference = Data.Root.ChannelGroups("TestResults").Channels("TestChannel").GetReference(eRefTypeIndexIndex)
oCol3.Channel.Reference = Data.Root.ChannelGroups("TestResults").Channels("TestLimitMin").GetReference(eRefTypeIndexIndex)
oCol4.Channel.Reference = Data.Root.ChannelGroups("TestResults").Channels("TestLimitMax").GetReference(eRefTypeIndexIndex)
oCol5.Channel.Reference = Data.Root.ChannelGroups("TestResults").Channels("TestValMeas").GetReference(eRefTypeIndexIndex)
oCol6.Channel.Reference = Data.Root.ChannelGroups("TestResults").Channels("TestUnit").GetReference(eRefTypeIndexIndex)
oCol7.Channel.Reference = Data.Root.ChannelGroups("TestResults").Channels("TestResult").GetReference(eRefTypeIndexIndex)
'Add UserCommand
oTable.Columns(7).Settings.OnDrawingCell = "MyOnDrawingCell"
'Position
oTable.Position.ByBorder.Top = 1.356
oTable.Position.ByBorder.Bottom = 4.069
oTable.Position.ByBorder.Left = 1.654
oTable.Position.ByBorder.Right = 1.6
'Size
oCol1.Settings.Font.Size = 10
'Refresh
report.Refresh
Actual status of report
Needed status of report