>
>ActiveSheet.PivotTables("PivotTable").PivotFields("title").Subtotals = Array( _
> False, False, False, False, False, False, False, False, False, False, False, False)
>
>
>I get ole error if i specify oPivotTables.pivotFields("title").subtotals = .f.
>
>How to get the equivalent of Array(False, False, False, False, False, False, False, False, False, False, False, False) in VFP
>
>
>2. I have a pivot field title in orientation =3 && page field, how can i specify the value of the title to be say 'Programmer'
>
>I created a macro and tried it but it also fires a error,here the code
>
>use detail
>titl=detail.title
>oPivotTable.PivotFields("Title").CurrentPage=titl
>
>
>TIA
1) Use nIndex parameter of Subtotals. If you set subtotals(1) to .t. (Automatic) first array element is set to .T. and rest is set to .F. First do that to set rest to .F. then set first to .F. ie:
with ox.ActiveWorkBook.ActiveSheet.PivotTables("PivotTable")
.PivotFields("title").Subtotals(1) = .T.
.PivotFields("title").Subtotals(1) = .F.
endwith
2) Your detail.line might have trailing spaces. Trailing spaces are removed from pivotitems and Excel is not smart as VFP on a nonexact match.
use detail
titl=trim(detail.title)
oPivotTable.PivotFields("Title").CurrentPage=titl
Cetin