InsertTable Method (Python)
Inserts an empty pivot table after the item designated as the current item. The inserted table is populated with default row, column and layer labels, and becomes the current item. Note: You can use the SetCurrentItem method to designate an item as the current item.
Syntax
index=SpssOutputDoc.InsertTable(heading,nrows,ncolumns,nlayers)
Parameters
heading. A string specifying the heading for this table in the outline pane of the Viewer.
nrows. An integer specifying the number of rows in the table. Specifying zero will result in a table with one row.
ncolumns. An integer specifying the number of columns in the table. Specifying zero will result in a table with one column.
nlayers. An integer specifying the number of layers in the table.
Return Value
index. The index of the new table item. The index corresponds to the order of the items in the output document, starting with 0 for the root item.
Example
This example inserts a pivot table with four rows, three columns and no layers. The table is inserted after the root item.
import SpssClient
SpssClient.StartClient()
OutputDoc = SpssClient.GetDesignatedOutputDoc()
OutputItems = OutputDoc.GetOutputItems()
OutputItem = OutputItems.GetItemAt(0)
OutputItem.SetCurrentItem()
index = OutputDoc.InsertTable("Sample table",4,3,0)