I was wondering how to insert a table into a rectangle shape.
This is my Shape where I want to insert a table into:
var firstSectionWhite = new Shape(document, ShapeType.RoundedRectangle, Layout.Floating(
new HorizontalPosition(15, LengthUnit.Pixel, HorizontalPositionAnchor.TopLeftCorner),
new VerticalPosition(70, LengthUnit.Pixel, VerticalPositionAnchor.TopLeftCorner),
new Size(pageSetup.PageWidth - 175, 100, LengthUnit.Point)));
firstSectionWhite.AdjustValues["adj"] = 5000;
firstSectionWhite.Outline.Fill.SetEmpty();
firstSectionWhite.Fill.SetSolid(Color.White);
ItemGroup.Add(firstSectionWhite);
and here is my Table:
List<string> Items = new List<string> { "Description: End User Computing", "Recovery Order: 25", "Mtpd: 02:00 hours" };
int rowCount = 3;
int columnCount = 2;
var table = new Table(document);
table.TableFormat.PreferredWidth = new TableWidth(100, TableWidthUnit.Point);
section.Blocks.Add(table);
for (int i = 0; i < rowCount; i++)
{
var row = new TableRow(document);
table.Rows.Add(row);
for (int c = 0; c < columnCount; c++)
{
var cell = new TableCell(document);
row.Cells.Add(cell);
cell.Blocks.Add(new Paragraph(document, "TestCells"));
}
}
Thanks for any help