R
RayTheOtherRay
I searched and found a helpful post allowing me to access PivotViews,
FieldSets, and Fields on the page that I'm trying to automate. But the
examples were presented in VB. I'm trying to do the same thing with
JavaScript.
I have an OLAP Cube Dimension named Calendar.
The levels in Calendar are Year, Month, WeekEnding and Date.
Below is my current code that is place below the "Wizard generated"
HTML code published from the Excel Spreadsheet.
<script language="javascript">
var pt = document.getElementById ('Book1_24147_PivotTable');
var pv = pt.ActiveView;
var fs = pv.FieldSets("[Calendar]");
var fld = fs.Fields("[Calendar].[Year]");
var inyr = new Array(4);
var x = 0
for (x = 0; x < 4; x++)
{
inyr[x] = "[Calendar].[All Dates].[" + (x + 2002) + "]";
}
alert(inyr[3]);
var exyr = new Array(27);
var y = 0
for (y = 0; y < 6; y++)
{
exyr[y] = "[Calendar].[All Dates].[" + (y + 1996) + "]";
}
alert(exyr[3]);
for (y = 6; y < 27; y++)
{
exyr[y] = "[Calendar].[All Dates].[" + (y + 2000) + "]";
}
alert(exyr[26]);
fld.IncludeMembers = inyr;
fld.ExcludeMembers = exyr;
fs.AllIncludeExclude = plAllExclude;
</script>
Using the Alert statements, I can see that the arrays are being filled.
When I add the .IncludeMembers, .ExcludeMembers, and
..AllIncludeExclude statements the refreshed page status is "Done" but
no filtering takes place.
Is there something obvious that I'm overlooking?
Thanks!
Ray <><
FieldSets, and Fields on the page that I'm trying to automate. But the
examples were presented in VB. I'm trying to do the same thing with
JavaScript.
I have an OLAP Cube Dimension named Calendar.
The levels in Calendar are Year, Month, WeekEnding and Date.
Below is my current code that is place below the "Wizard generated"
HTML code published from the Excel Spreadsheet.
<script language="javascript">
var pt = document.getElementById ('Book1_24147_PivotTable');
var pv = pt.ActiveView;
var fs = pv.FieldSets("[Calendar]");
var fld = fs.Fields("[Calendar].[Year]");
var inyr = new Array(4);
var x = 0
for (x = 0; x < 4; x++)
{
inyr[x] = "[Calendar].[All Dates].[" + (x + 2002) + "]";
}
alert(inyr[3]);
var exyr = new Array(27);
var y = 0
for (y = 0; y < 6; y++)
{
exyr[y] = "[Calendar].[All Dates].[" + (y + 1996) + "]";
}
alert(exyr[3]);
for (y = 6; y < 27; y++)
{
exyr[y] = "[Calendar].[All Dates].[" + (y + 2000) + "]";
}
alert(exyr[26]);
fld.IncludeMembers = inyr;
fld.ExcludeMembers = exyr;
fs.AllIncludeExclude = plAllExclude;
</script>
Using the Alert statements, I can see that the arrays are being filled.
When I add the .IncludeMembers, .ExcludeMembers, and
..AllIncludeExclude statements the refreshed page status is "Done" but
no filtering takes place.
Is there something obvious that I'm overlooking?
Thanks!
Ray <><