Control Reference > VSPrinter Control > VSPrinter Methods > StartTable Method |
Defers table rendering until call to EndTable.
[form!]VSPrinter.StartTable
If you create a table with the AddTable or AddTableArray methods, the table is rendered immediately. This is a good approach for creating simple tables, but it does not allow you to perform complex formatting on the table.
On the other hand, if you enclose the calls to AddTable or AddTableArray between calls to StartTable and EndTable, the table is not rendered until the call to EndTable is made. This allows you to perform complex formatting on the table using the TableCell property.
Here is some pseudo-code that shows how the second approach works:
' start the table
vp.StartTable
' set basic format and some data
vp.AddTable Format, Header, Body
' make top left cell bold and red
vp.TableCell(tcFontBold, 1, 1) = True
vp.TableCell(tcBackColor, 1, 1) = vbRed
' done, render the table
vp.EndTable
For a complete example, see the VSPrinter Tutorial - Calendar topic.