PivotTable custom "Show Top..." filter

P

Paul Skelton

I've worked with OWC quite a bit and know how to add custom menu items but
I'm not sure how the PivotTable implements the "Show only the top 10", 25,
25%, etc. What I'd like to do is have my custom menu implement a filter
that does something like "Show values > 1,000". Is there some programmatic
way to perform the same sort of filtering that the PivotTable does with the
"Show only top / bottom" menus?
 
P

Paul Skelton

I took a look at the FilterFunction but unless I'm missing something it
doesn't look like that will work. I only want to show rows that have a
value > 1,000.

Microsoft.Office.Interop.Owc11.PivotFieldFilterFunctionEnum only contains
Count, Percent, and Sum options - none of which are what I am looking for.



Thanks!


Alvin Bruney said:
Yup, you can use the filterfunction method to filter by a top number of
quantities.

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------


Paul Skelton said:
I've worked with OWC quite a bit and know how to add custom menu items
but I'm not sure how the PivotTable implements the "Show only the top
10", 25, 25%, etc. What I'd like to do is have my custom menu implement
a filter that does something like "Show values > 1,000". Is there some
programmatic way to perform the same sort of filtering that the
PivotTable does with the "Show only top / bottom" menus?
 
A

Alvin Bruney [MVP]

How about using the macro recorder in Excel? Turn it on, hook up your pivot
table and filter on your criteria. When you are done, have a look at the VBA
script that the macro recorder generated and port it to your code. That's a
sure-fire way to get what you want.

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------


Paul Skelton said:
I took a look at the FilterFunction but unless I'm missing something it
doesn't look like that will work. I only want to show rows that have a
value > 1,000.

Microsoft.Office.Interop.Owc11.PivotFieldFilterFunctionEnum only contains
Count, Percent, and Sum options - none of which are what I am looking for.



Thanks!


Alvin Bruney said:
Yup, you can use the filterfunction method to filter by a top number of
quantities.

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------


Paul Skelton said:
I've worked with OWC quite a bit and know how to add custom menu items
but I'm not sure how the PivotTable implements the "Show only the top
10", 25, 25%, etc. What I'd like to do is have my custom menu implement
a filter that does something like "Show values > 1,000". Is there some
programmatic way to perform the same sort of filtering that the
PivotTable does with the "Show only top / bottom" menus?
 
P

Paul Skelton

I tried playing with Excel but that didn't help. The OWC pivot table is
different than the Excel pivot table. Maybe I just don't know how to use
Excel pivot tables properly but I couldn't find a way to create the sort of
filter I'm after within the Excel UI.

Thanks!
Paul


Alvin Bruney said:
How about using the macro recorder in Excel? Turn it on, hook up your
pivot table and filter on your criteria. When you are done, have a look at
the VBA script that the macro recorder generated and port it to your code.
That's a sure-fire way to get what you want.

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------


Paul Skelton said:
I took a look at the FilterFunction but unless I'm missing something it
doesn't look like that will work. I only want to show rows that have a
value > 1,000.

Microsoft.Office.Interop.Owc11.PivotFieldFilterFunctionEnum only contains
Count, Percent, and Sum options - none of which are what I am looking
for.



Thanks!


Alvin Bruney said:
Yup, you can use the filterfunction method to filter by a top number of
quantities.

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------


I've worked with OWC quite a bit and know how to add custom menu items
but I'm not sure how the PivotTable implements the "Show only the top
10", 25, 25%, etc. What I'd like to do is have my custom menu
implement a filter that does something like "Show values > 1,000". Is
there some programmatic way to perform the same sort of filtering that
the PivotTable does with the "Show only top / bottom" menus?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top