I’d like to create dinamically many tables.
Could you please provide me with sample how to do that?
I tried to do that in following manner but failed and no example found on this site.
builder.Writeln();
// Adding header row of Summary Table
DataRow drHeader = tblSummary.Rows[0];
builder.Font.ClearFormatting();
builder.StartTable();
for (int j = 0; j < tblSummary.Columns.Count; j++)
{
builder.RowFormat.Alignment = RowAlignment.Center;
builder.InsertCell();
builder.Write(drHeader[j].ToString());
}
builder.EndRow();
builder.EndTable();
// --... After that I'm adding new table like that:
builder.Font.ClearFormatting();
builder.StartTable();
for (int i = 0; i < tbl.Rows.Count; i++)
{
for (int j = 0; j < tbl.Columns.Count; j++)
{
builder.RowFormat.Alignment = RowAlignment.Center;
builder.InsertCell();
builder.Write(tbl.Rows[i][j].ToString());
}
builder.EndRow();
}
builder.EndTable();
But that code doesn’t produce tables in Aspose.Word document.
Only 1 table can be buit successfully (without another one).