Help with creating a Pivot Table Filter programatically

C

Chris Magoun

I am displaying OLAP data in a VB.NET app using the OWC PivotTable component
(via the Primary Interop Assemblies). I would like to filter the members
that appear on the RowAxis, but I am having trouble passing an array to the
IncludedMembers property. Here is sample code:

Dim av As PivotView = pt.ActiveView

av.RowAxis.InsertFieldSet(av.FieldSets("Provider"), Nothing, True)

Dim aIncl() As String

aIncl(0) = "[Provider].[All Provider].[Adams County Memorial Hospital]"

aIncl(1) = "[Provider].[All Provider].[Apple River Hospital - Amery]"

aIncl(2) = "[Provider].[All Provider].[Appleton Medical Center]"

av.RowAxis.FieldSets("Provider").AllIncludeExclude =
PivotFieldSetAllIncludeExcludeEnum.plAllExclude

av.RowAxis.FieldSets("Provider").Fields(0).IncludedMembers = aIncl

With this code, I get the error "Parameter is incorrect" on the last line.
If I populate the pivot table with an MDX query, I can see the
IncludedMembers array, but I cannot populate it.

Does anyone have any suggestions?

Chris Magoun
 
C

Chris Magoun

Ok, if I change the array declaration to

Dim aIncl() as Object

it works.

Chris
 

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