SetUpdateScreen Method (Python)
Sets whether changes in the pivot table are refreshed immediately. The argument is Boolean--True if changes are refreshed immediately, False otherwise.
- By default, changes are refreshed immediately.
Syntax
SpssPivotTable.SetUpdateScreen(boolean)
Example
This example assumes that PivotTable is an SpssPivotTable
object,
and stops refreshing while looping through the row labels and making
changes.
PivotTable.SetUpdateScreen(False)
rowlabels = PivotTable.RowLabelArray()
for i in range(rowlabels.GetNumRows()):
for j in range(rowlabels.GetNumColumns()):
if rowlabels.GetValueAt(i,j)=="Female":
rowlabels.SetValueAt(i,j,"Women")
PivotTable.SetUpdateScreen(True)
Note: Setting the immediate refresh off (parameter set to False) prevents flashing when you make changes to individual cells in a loop (in internal scripting), but it may also prevent you assessing the results immediately. A better way is to avoid making changes cell by cell but select the cells and change the selection using a method on the pivot table object. This is also a faster way.