XLPivot .SubTotals

SteveKnott
Member Posts: 49
Hi,
In excel vba - i can turn subtotals off for a field in a pivot table..
e.g. below..
For Each pt In ActiveSheet.PivotTables
For Each pf In pt.PivotFields
'First, set index 1 (Automatic) to True,
'so all other values are set to False
pf.Subtotals(1) = True
pf.Subtotals(1) = False
Next pf
Next pt
but in NAV - ( First 2 lines work fine - but the Subtotals line doesn't compile.. ( A variable is expected?)
xlPvtField := xlPivot.PivotFields('Product');
xlPvtField.Orientation := 1; //xlRowField
xlPvtField.Subtotals(1) := false ;
Any ideas ?
.Subtotals returns an array with no params , but the 1 is the Automatic totals.
Other option i have it to set the whole subtotals array... like the Excel VBA below.. \
.Subtotals = Array(False, False, False, False, False, False, False, False, False, False, False, False)
but not sure how to make the Array...
FOR i := 1 TO 12 DO BEGIN
ArrayFalse := FALSE;
END;
xlPvtField := xlPivot.PivotFields('Product');
xlPvtField.Orientation := 1;
xlPvtField.Subtotals := ArrayFalse;
That also doesnt compile... Array Dimensions must be identical...
Any ideas ?
Thanks,
Steve
In excel vba - i can turn subtotals off for a field in a pivot table..
e.g. below..
For Each pt In ActiveSheet.PivotTables
For Each pf In pt.PivotFields
'First, set index 1 (Automatic) to True,
'so all other values are set to False
pf.Subtotals(1) = True
pf.Subtotals(1) = False
Next pf
Next pt
but in NAV - ( First 2 lines work fine - but the Subtotals line doesn't compile.. ( A variable is expected?)
xlPvtField := xlPivot.PivotFields('Product');
xlPvtField.Orientation := 1; //xlRowField
xlPvtField.Subtotals(1) := false ;
Any ideas ?
.Subtotals returns an array with no params , but the 1 is the Automatic totals.
Other option i have it to set the whole subtotals array... like the Excel VBA below.. \
.Subtotals = Array(False, False, False, False, False, False, False, False, False, False, False, False)
but not sure how to make the Array...
FOR i := 1 TO 12 DO BEGIN
ArrayFalse := FALSE;
END;
xlPvtField := xlPivot.PivotFields('Product');
xlPvtField.Orientation := 1;
xlPvtField.Subtotals := ArrayFalse;
That also doesnt compile... Array Dimensions must be identical...
Any ideas ?
Thanks,
Steve
0
Answers
-
xlPvtField.Subtotals(1, FALSE)0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions