Python scripting: why is "HideLabelsWithDataAt" ignored here?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Python scripting: why is "HideLabelsWithDataAt" ignored here?

sergio_da_silva
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.
Reply | Threaded
Open this post in threaded view
|

Automatic reply: Python scripting: why is "HideLabelsWithDataAt" ignored here?

Harmon, Judith, PED



I will be out of the office until Monday February 18th.  If you need assistance with SOAP, please contact Pascal Buser at [hidden email] or by phone at 505-827-6595 or Kennedy Baiywo at 505-827-6721. I will respond to your e-mail when I return.

 Thanks!