Hello all,
I’m updating a Xojo app. I’m using Xojo’s server based PDF implementation.
Would someone be so kind as to tell me what I’m doing wrong here in attempting to construct a basic table.
Var d As New PDFDocument(PDFDocument.PageSizes.A4)
Var g As Graphics = d.Graphics
Var t As New PDFTable
t.ColumnCount = 3
t.ColumnWidths = "150,150,150"
Var tds As PDFTableDataSource
tds.PaintHeaderContent(g.DrawText("ColOneHeader", 10, 25, 150), 0)
tds.PaintHeaderContent(g.DrawText("ColTwoHeader", 10, 25, 150), 1)
tds.PaintHeaderContent(g.DrawText("ColThreeHeader", 10, 25, 150), 2)
tds.PaintCell(g.DrawText("RowOneColOne", 10, 50, 150), 0, 0)
tds.PaintCell(g.DrawText("RowOneColTwo", 160, 50, 150), 0, 1)
tds.PaintCell(g.DrawText("RowOneColThree", 310, 50, 150), 0, 2)
tds.PaintCell(g.DrawText("RowTwoColOne", 10, 75, 150), 0, 0)
tds.PaintCell(g.DrawText("RowTwoColTwo", 160, 75, 150), 0, 1)
tds.PaintCell(g.DrawText("RowTwoColThree", 310, 75, 150), 0, 2)
t.DataSource = tds
d.AddTable(t, 40, 40)
wf = New WebFile
wf.Data = d.ToData
wf.MIMEType = "application/pdf"
WebDialog11.HTMLViewer1.LoadURL(wf.URL)
WebDialog11.Show
I’m not 100% sure on how to correctly use PaintHeader / PaintCell.
I couldn’t find a basic example in the docs.
Thank you!
Kind regards, Andrew