DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Delete a Row of a 2DTable in a Report with Script

Solved!
Go to solution

Hello all,

 

how can I delete a row of a 2DTable? There is already a solved topic with examples, but the links of them are dead.

 

Thank you and best regards

 

Mark

0 Kudos
Message 1 of 3
(1,127 Views)

Hello Mark,

 

The IndexSettings object of the table can be used to set whether the number of rows is fixed or should be determined automatically, for example. Depending on what is suitable for you set IndexSettings.IndexMode to the value e2DTableIndexModeFixed or e2DTableIndexModeAutomaticallyIncreasing.

 

The following code adds a new table with one column and set the row count to 20:

 

dim Table, RowCount, Column
set Table = Report.Sheets(1).Objects.Add(eReportObject2DTable, "myTable")
Table.Position.ByBorder.Bottom = 30

' Add a column
set Column = Table.Columns.Add(e2DTableColumnChannel)
Column.Channel.Reference = "[1]/Time"

' The default mode for the new added table scaling is e2DTableIndexModeFixed
RowCount = 20
Table.Settings.IndexSettings.IndexEnd = RowCount

call Report.Refresh

 

 

If you don't want to set a fixed number of rows, then let the table determine the number of rows.

 

dim Table, Column
set Table = Report.Sheets(1).Objects.Add(eReportObject2DTable, "myTable")
Table.Position.ByBorder.Bottom = 30

' Add a column
set Column = Table.Columns.Add(e2DTableColumnChannel)
Column.Channel.Reference = "[1]/Time"

' Use the mode e2DTableIndexModeAutomaticallyIncreasing instead of fixed row count
Table.Settings.IndexSettings.IndexMode = e2DTableIndexModeAutomaticallyIncreasing

call Report.Refresh

 

 

Regards

AnJalpaka

0 Kudos
Message 2 of 3
(1,101 Views)
Solution
Accepted by topic author Mark1978

Hello AnJalpaka,

 

thank you so much for your help. 

Understood, you have used a channel. I have used 2DTable with Text-Data.

So I will use the Channel-Data to delete the rows by deleting some indices of the channel.

 

Best regards

Mark

0 Kudos
Message 3 of 3
(1,093 Views)