Check 1 item in the filter list opening the OWC - Pivottable

  • Thread starter Screaming Eagles 101
  • Start date
S

Screaming Eagles 101

Opening a page with a pivot table, we have a filter list where all
possibilities are checked by default.
Can we write code to check only the first item in the filter list ?
 
A

Alvin Bruney - ASP.NET MVP

Yes, you will need to get a reference to the filter axis and iterate it
accordingly

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
 
R

Richard Ch

Maybe something like:
set fld = pivottable.ActiveView.FilterAxis.FieldSets().Fields()
fld.IncludedMembers = array(name)
set fld = nothing
Ta,
Richard
 
S

Screaming Eagles 101

Thanks !
Found this too and it works.
I have a filter on a column called MyDate
set ptview = ptable.activeview
ptview.FilterAxis.FieldSets("MyDate").BoundField.IncludedMembers =
Date() - 1
 

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