Skip to content

TrganTable

TrganTable enables you to define a structured, column-based table within a Trgan Report. It’s designed to capture execution outcomes for targeted use cases, making it easier to organize result data. Instantiating the TrganTable,

1
2
//Define the maximum number of columns required
var trganTable = trgan.TrganTable(columnCount : 3);

Add Columns

Columns can be added to the Trgan Table by calling AddColumn function, which takes a string parameter as column name. Any number of columns can be created but it should not exceeds the count of columns defined during trgan table initialization and unfilled column slots are ignored.

1
2
3
4
// Define the column names
trganTable.AddColumn("colName1");
trganTable.AddColumn("colName2");
trganTable.AddColumn("colName3");

Add Row Entries

Use AddEntry() to create a new row and then assign values using dynamic property syntax:

1
2
3
4
5
6
7
// Create new row
var row = table.AddEntry();

// Add values to the created row
row.ValueOf.Name = "Alice";
row.ValueOf.Age = "12";
row.ValueOf.Class = "7A"; 

Note

Column names must be added before adding entries. Each row supports dynamic assignment using ValueOf. Unassigned columns will default to empty strings.