Posted by a ceTe Software moderator
Hello,
Yes, you can add text below the overflow table contents without any problem using our DynamicPDF Generator product. You will need to build the complete table using Table2 class and add it to the PDF by checking for overflow rows accordingly, then keep track of Y position and height of the overflow table using two local variables. Use the calculated Y position to add the TextArea after the table. Here is the sample VB code:
Dim tableYPoistion As Single
tableYPoistion = 0
Dim tableHeight As Single
tableHeight = 0
Dim MyDocument As DynamicPDF.Document
Dim MyPage As DynamicPDF.Page
Set MyDocument = New DynamicPDF.Document
Set MyPage = MyDocument.AddPage()
Dim MyTable As DynamicPDF.Table2
Set MyTable = MyPage.AddTable2(0, 0, 200, 700)
MyTable.AddColumn2 (100)
MyTable.AddColumn2 (100)
' This loop populates the table
Dim I As Integer
For I = 1 To 400
Dim MyRow As DynamicPDF.Row2
Set MyRow = MyTable.AddRow2()
MyRow.AddCell2 ("Row #" & I)
MyRow.AddCell2 ("Item")
Next
Do
Dim MyOverflowTable As DynamicPDF.Table2
Set MyOverflowTable = MyTable.GetOverFlowRows()
If Not (MyOverflowTable Is Nothing) Then
Set MyPage = MyDocument.AddPage()
Set MyTable = MyPage.AddOverflowTable2(MyOverflowTable)
'get the Y position of the Table2
tableYPoistion = MyTable.Y
'Get the visible height od overflow table.
tableHeight = MyTable.GetVisibleHeight()
End If
Loop While Not (MyOverflowTable Is Nothing)
Dim MyTextArea As DynamicPDF.TextArea
Dim padding As Single
padding = 10
'Calculate Y position for TextArea.
Dim YPosition As Single
YPosition = tableYPoistion + tableHeight + padding
'Add the TextArea with calulated Y position and Height to the Page.
Set MyTextArea = MyPage.AddTextArea("My TEXT", 100, YPosition, 200, 30, DPDF_Align_Left, DPDF_Font_Helvetica, 12)
MyDocument.DrawToFile ("C:\Temp\Mydocuent_COM.pdf")
Thanks,
ceTe Software Support Team.