I have a maste table that has other tables within it and have no problem implementing the GetOverflowRows().
The problem I am having is when a specific cell has more text than can fit on one page, how does one break the content in that cell apart?
Thanks for any help!
i.Narrative is the large amount of text (around page and a half).
Here's a code snippet:
'Master table
Dim tableMaster As Table = New Table(0, 60, 576, 671)
tableMaster.Width = 576
tableMaster.Columns.Add(576)
tableMaster.BorderWidth = 0
Dim MasterRowNarrative As Row = tableMaster.Rows.Add
Dim tableNarrative As Table = New Table(0, 0, 572, 25)
tableNarrative.Columns.Add(572)
tableNarrative.BorderWidth = 1
Dim TableNarrativeRow1 As Row = tableNarrative.Rows.Add(8, Font.TimesBold, 7, RgbColor.Black, RgbColor.White)
Dim TableNarrativeRow2 As Row = tableNarrative.Rows.Add(8, Font.TimesRoman, 7, RgbColor.Black, RgbColor.White)
TableNarrativeRow1.BackgroundColor = Grayscale.Silver
TableNarrativeRow1.Cells.Add("Narrative").Align = CellAlign.Left
'*****************************************************
'THIS IS THE CELL THAT HAS THE LARGE AMOUNT OF TEXT THAT NEEDS
'TO BE BROKEN UP ACROSS MULTIPLE PAGES (IF NECESSARY)
'************************************************************
Dim NarrativeCell As Cell = TableNarrativeRow2.Cells.Add(i.Narrative)
NarrativeCell.Align = CellAlign.Left
'Set the actual table height
tableNarrative.Height = tableNarrative.GetRequiredHeight
MasterRowNarrative.Cells.Add(tableNarrative)
Do
Dim MyPage As Page = New Page(PageSize.Letter)
MyPage.Dimensions.SetMargins(18, 18, 18, 18)
MyPage.Elements.Add(tableMaster)
MyDocument.Pages.Add(MyPage)
tableMaster = tableMaster.GetOverflowRows()
Loop While Not (tableMaster Is Nothing)
'Add the template to the document
MyDocument.Template = MyTemplate
MyDocument.Draw(sDocumentPath & "\" & sDocumentName & ".pdf")