View Full Version : PivotTable custom "Show Top..." filter


Paul Skelton
06-09-2006, 06:19 PM
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?

Alvin Bruney [MVP]
06-11-2006, 05:24 PM
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" <rpskelton2@hotmail.com> wrote in message
news:%23O7gvj%23iGHA.4504@TK2MSFTNGP05.phx.gbl...
> 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?
>
>
>

Paul Skelton
06-11-2006, 08:26 PM
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 [MVP]" <www.lulu.com/owc> wrote in message
news:OPJLEOXjGHA.3780@TK2MSFTNGP03.phx.gbl...
> 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" <rpskelton2@hotmail.com> wrote in message
> news:%23O7gvj%23iGHA.4504@TK2MSFTNGP05.phx.gbl...
>> 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?
>>
>>
>>
>
>

Alvin Bruney [MVP]
06-11-2006, 11:44 PM
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" <rpskelton2@hotmail.com> wrote in message
news:%237p3wzYjGHA.3496@TK2MSFTNGP02.phx.gbl...
>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 [MVP]" <www.lulu.com/owc> wrote in message
> news:OPJLEOXjGHA.3780@TK2MSFTNGP03.phx.gbl...
>> 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" <rpskelton2@hotmail.com> wrote in message
>> news:%23O7gvj%23iGHA.4504@TK2MSFTNGP05.phx.gbl...
>>> 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?
>>>
>>>
>>>
>>
>>
>
>

Paul Skelton
06-12-2006, 05:38 PM
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 [MVP]" <www.lulu.com/owc> wrote in message
news:%2398pXiajGHA.1324@TK2MSFTNGP04.phx.gbl...
> 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" <rpskelton2@hotmail.com> wrote in message
> news:%237p3wzYjGHA.3496@TK2MSFTNGP02.phx.gbl...
>>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 [MVP]" <www.lulu.com/owc> wrote in message
>> news:OPJLEOXjGHA.3780@TK2MSFTNGP03.phx.gbl...
>>> 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" <rpskelton2@hotmail.com> wrote in message
>>> news:%23O7gvj%23iGHA.4504@TK2MSFTNGP05.phx.gbl...
>>>> 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?
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>