Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Help! Turning off PivotTable Subtotals

Hello,

I'm trying to turn off Excel 2002 PivotTable Subtotals
using C#.NET. I'm able to set other field properties, but
I cannot figure out how to use the set_Subtotals method or
locate that .Subtotals property that so many Excel 97
programming examples use. Sample of my attached code
below. Any help would be greatly appreciated.

Thanks,
Jim

Excel._Workbook oWB;
Excel._Worksheet
oSheet;
Excel.PivotCache
pivotCache;
Excel.PivotTable
pivotTable;
Excel.PivotField
pivotField;
string
sourceData;
Excel.Range
oRng;

oWB = mXL.Workbook;
oSheet = (Excel.Worksheet)
oWB.Sheets.Add(Type.Missing, Type.Missing, Type.Missing,
Type.Missing);
oRng = oSheet.get_Range
("A7","A7").Cells;

Excel.PivotCaches pivotCaches =
oWB.PivotCaches();
sourceData = "Data!R1C1:R" +
mLastRow + "C" + mLastCol;
pivotCache = pivotCaches.Add
(Excel.XlPivotTableSourceType.xlDatabase, sourceData);

pivotTable =
pivotCache.CreatePivotTable(oRng, "Flow-Through",
Type.Missing,
Excel.XlPivotTableVersionList.xlPivotTableVersionC urrent);

pivotTable.SmallGrid = false;

// Pivot Table Page Area
pivotField = (Excel.PivotField)
pivotTable.PivotFields("Region");
pivotField.Orientation =
Excel.XlPivotFieldOrientation.xlPageField;
pivotField.Position = 1;

pivotField = (Excel.PivotField)
pivotTable.PivotFields("Opportunity Owner");
pivotField.Orientation =
Excel.XlPivotFieldOrientation.xlPageField;
pivotField.Position = 1;

// Pivot Table Row Area
pivotField = (Excel.PivotField)
pivotTable.PivotFields("Account Name");
pivotField.Orientation =
Excel.XlPivotFieldOrientation.xlRowField;
pivotField.Position = 1;

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Globally deleted SubTotals in a PivotTable Joey Excel Discussion (Misc queries) 3 April 9th 08 06:00 PM
Creating a PivotTable w/o selecting data in an existing PivotTable Damian Excel Discussion (Misc queries) 6 November 2nd 07 04:44 PM
Why are some subtotals missing from my pivottable? debbie.b Excel Discussion (Misc queries) 0 August 17th 07 02:05 AM
Turning off pivot table subtotals in Excel 2002 Tim Whitley Excel Discussion (Misc queries) 1 July 16th 07 08:28 PM
PivotTable Automatic Subtotals Monica Hall Excel Discussion (Misc queries) 0 January 10th 06 01:04 AM


All times are GMT +1. The time now is 11:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"