Date: Thu, 28 Mar 2024 22:17:11 +0100 (CET) Message-ID: <1501491278.1137.1711660631523@nm-docs> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_1136_1631130631.1711660631523" ------=_Part_1136_1631130631.1711660631523 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
The code in this section demonstrates some scenarios with a Gene= ric Table tool. The code may not be executable or may not return the correc= t result. This is only the idea of how to use the Generic Table tool and ho= w it works.
The code shown below prints the row, column, and its value in the form o= f an HTML table.
#foreac= h($diagram in $project.getDiagrams("Generic Table")) =09 <table> =09 <tr> =09 #set($table =3D $generic.getTable($diagram)) =09 <td>#</td> =09 #foreach($colName in $table.columnNames) =09=09 <td>$colName</td> =09 #end =09 </tr> =09 #foreach($row in $table.rows) =09 <tr> =09=09 <td>$velocityCount</td> =09 #foreach($col in $table.columnIds) =09=09 <td>$table.getValueAsString($row, $col)</td> =09 #end =09 </tr> =09 #end =09 </table> =09#end
You can retrieve other diagram table types by using the complete code sh= own below for getting values from the Generic Table:
Note
You can customize line of code, e.g., by adding diagram table types to g= et the Metric Table or Instance Table, as shown below:
#if($di= agram.diagramType =3D=3D =E2=80=9CMetric Table=E2=80=9D || $diagram.diagram= Type =3D=3D =E2=80=9CInstance Table=E2=80=9D)