OWC 10.0 Pivot - Trouble setting filter fields includedmembers property

M

Michael Weiss

I am using vbscript & DHTML in a .asp file to diplay data
in a OWC 10.0 Pivot control. I want to filter the data
displayed by date range. Using the following code, I am
trying to set the Filter Axis' fieldset's fields'
includedmembers property to a variant array containing a
comma-delimited string of dates. When I use the code
below the control filters the displayed data properly.

'add in a filter for the call date here & load with
values in arrDates:
pview.FilterAxis.InsertFieldSet pview.FieldSets
("Call Date2")
pview.FilterAxis.FieldSets("Call
Date2").AllIncludeExclude = ptable.constants.plAllExclude
pview.filteraxis.fieldsets("Call Date2").fields
("Call Date").includedmembers = _
Array("11/01/2003","11/02/2003")

However, I need to pass in the date range parameter
values dynamically. When I pass a string variable
containing a string such
as ""11/01/2003","11/02/2003","11/03/2003"" to a variant
array which then is passed to the includedmembers
property the pivot control displays all data, not the
filtered data. The function builddaterange() builds the
string of dates for the includedmembers property.

'build the date criteria (if any) here:
strDateRange = ""
strDateRange = builddaterange(txtBegDate.value,
txtEndDate.value)

If strDateRange <> "" Then
'add in a filter for the call date here & load with
values in arrDates:
pview.FilterAxis.InsertFieldSet pview.FieldSets
("Call Date2")
pview.FilterAxis.FieldSets("Call
Date2").AllIncludeExclude = ptable.constants.plAllExclude
pview.filteraxis.fieldsets("Call Date2").fields
("Call Date").includedmembers = _
Array(strDateRange)
End If

Obviously I am missing something here. Does anyone know
what I may be doing wrong in passsing in the string
variable value?
Thank you,
Michael
 
G

Gary Heaven

Use Split(strDateRange,",") instead of Array(..

Be careful though - you end up with an array of strings (not dates).

Gary Heaven
"feet are over rated"
 
M

Michael Weiss

An interesting note...
I came across an example where they set the filter member
(s) using an object variable passed via a variant array
such as:
ptable.FilterAxis.InsertFieldset ptable.fieldsets("Store")
Set CA = ptable.fieldsets("Store").Members(0).Childmembers
("USA").Childmembers("CA")
Set WA = ptable.fieldsets("Store").Members(0).Childmembers
("USA").Childmembers("WA")
ptable.Fieldsets("Store").FilterMember = Array(CA, WA)

I thought this was interesting and may be helpful to
others struggling with the same issues. However, I want
to reiterate that your suggestion of using split()
instead of Array() with string values works perfectly.
Michael
 

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