The Invoice sample uses merging:
http://www.pdfsharp.net/wiki/Invoice-sample.ashx
The keywords are MergeRight and MergeDown. Use MergeRight=1
to get a cell that spans two columns.
I think merging is the best approach if it does not get too complicated.
You can add TextFrame
to a Cell
and add a Table
to a TextFrame
to achieve nested tables. However you will have to deal with the row height as the table cell will not grow automatically when the contents of the TextFrame grow.
There is a trick to add a Table
to a Cell
or Paragraph
in a cell using the generic Add
method.
Code hack that adds a table to a table cell:
parentCell.Elements.Add(currentTable);
This is an undocumented feature. Merging is the recommended approach.
Cells do not break to the next page, so adding tables to cells will work for small nested tables only.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…