This project has moved and is read-only. For the latest updates, please go here.

Pivot Table Collapse All Drilldowns on start and Hide Value columns

Mar 24, 2015 at 10:11 PM

I am fairly new to the Pivot Table concept and I am having some issues with two separate parts.

I am developing this in .NET 4.5 and C#

The first is when I start up by excel file, my pivot table has all the drill downs shown.


I would like them to be suppressed so It shows a general Summary, then if the user wants to, they can drill down from there. Like so:


Is there a property from the pivotable I am just not seeing?
currently I have these set on my pivottable...
            pivotTable.DataOnRows = false;
            pivotTable.ColumGrandTotals = false;
            pivotTable.Compact = false;
            pivotTable.CompactData = false;
            pivotTable.MultipleFieldFilters = true;
And for the other issue, As you can see in the first image, this pivot table just has Data columns. No Values.

Is there a way I can hide the value columns? So the table would not write onto 'P', 'Q', 'R', 'S', 'T', and 'U'?

I can do this on the Excel end but I didn't see any noticeable method in C#.

Thanks for the help.
Apr 13, 2015 at 11:40 PM
Edited Apr 13, 2015 at 11:40 PM
I couldn't find any way to do it... it'd be extremely useful indeed.

Meanwhile, if you don't mind working with an xlsm file you can read this :