this is an example of what i've been tryin
im working on a class that receives FIELD and SUMUP
field is the name of the pivotfield i want to modify, SUMUP is a boolean. tried that as a text too, but to no avail
opivottable.pivotfields(&field).subtotals(2) = sumup
I created opivottable this way:
dimension aSource[2]
oExcel = createobject("excel.application")
oExcel.Application.Visible = .T.
oWorkbook = oExcel.Workbooks.Add()
oTargetSheet = oWorkbook.Sheets.Add()
oTargetRange = oTargetSheet.range("A2")
aSource[1] = "Driver={Microsoft Visual FoxPro Driver};" +;
"SourceDB=" + dirorigen + ";SourceType=DBF;"
aSource[2] = "select * from archplano"
oPivotTable = oExcel.Sheets[1].PivotTableWizard( 2,;
@aSource, oTargetRange, "PivotTable", .T., .T. )