'**** B4I IOS Snippet ****
Private Sub CreatePDFPage
CreateMotherPanel
AddRowsToMother
SaveMotherToPDFCanvas
End Sub
Private Sub CreateMotherPanel
MotherPanel.Initialize("")
MotherPanel.Width = PDFWidth
MotherPanel.Height= PDFLength
TopIndex=0
End Sub
'Short Example showing column labels added to panels, panels being added to page as rows
Private Sub AddRowsToMother
Dim Col1,Col2,Col3,Col4 as Label
Dim PanelRow1,PanelRow2,PanelRow3,PanelRow4 as Panel
Col1.Initialize("")
Col1.text = "Quantity"
Col2.text = "Description"
etc,…
PanelRow1.Initialize("")
PanelRow1.AddView(Col1, …
PanelRow1.AddView(Col2, …
etc,…
MotherPanel.AddView(panelRow1, …
MotherPanel.AddView(panelRow2, ...
etc,...
End Sub
Private Sub SaveMotherToPDFCanvas
'Copy all views (row panels) to the PDF canvas
Dim PDFCanvas as Canvas
PDFCanvas.InitializePDF(File.DirLibrary,"Test.pdf",612,792)
For Each v As View In MotherPanel.GetAllViewsRecursive
If v Is Panel Then
Dim Rect As Rect
Dim pRow As Panel
pRow=v
Rect.Initialize(pRow.Left, pRow.Top, pRow.Left+pRow.Width, pRow.Top+pRow.Height)
PDFCanvas.DrawView(pRow,Rect)
End If
Next
PDFCanvas.NextPDFPage
End Sub