|
I have a (2*2) * 2 crosstab and I want to hide all totals from it. For now, my focus is just on the rows, if I can get that fixed, I'll probably figure out the columns myself.
I thought the "HideLabelsWithDataAt" method was the way to go here but I think I did not apply it properly (or perhaps my approach is not the right one altogether). I am not getting any kind of error or warning and the print statement does work properly.
I'd really appreciate if somebody could put me on the right track here.
My attempt so far:
begin program.
import SpssClient
SpssClient.StartClient()
outputDoc = SpssClient.GetDesignatedOutputDoc()
outputItems = outputDoc.GetOutputItems()
for index in range(outputItems.Size()):
outputItem = outputItems.GetItemAt(index)
if "Crosstabulation" in outputItem.GetDescription() and outputItem.GetType() == SpssClient.OutputItemType.PIVOT:
pivotTable = outputItem.GetSpecificType()
rLabels = pivotTable.RowLabelArray()
nRows = rLabels.GetNumRows()
for i in range(nRows):
nCols = rLabels.GetNumColumns()
for j in range(0,nCols):
print rLabels.GetValueAt(i,j)
if "Total" in rLabels.GetValueAt(i,j):
rLabels.HideLabelsWithDataAt(i,j) # Everything seems to work except for this line SpssClient.StopClient()
end program.
|