H
Hans Riis
Hi all.
I can control my date hierachy on my category axis in a chart with the
following code (always shows the last 25 days).
objPFS = ChartSpace1.InternalPivotTable.ActiveView.FieldSets("Date");
objPC = ChartSpace1.InternalPivotTable.Constants;
objPFS.AllIncludeExclude = objPC.plAllInclude;
objPFS.AllIncludeExclude = objPC.plAllExclude;
objPF = objPFS.Fields("Date");
var theDates = Array();
for(i=25 - 1;i>=0;i--) {
var DagsDato = new Date();
DagsDato.setDate(DagsDato.getDate() - i );
var day = DagsDato.getDate();
var monthNumber = DagsDato.getMonth();
var month = monthToMonthString(monthNumber + 1);
var year = "" + DagsDato.getFullYear();
theDates = theDates.concat(Array(objPFS.Member.ChildMembers(year).ChildMembers(month).ChildMembers(day
- 1)));
}
objPF.IncludedMembers = theDates;
}
The problem arises when I only want to show year and month (one year
back). It's easy when done with drag and drop. Just toss Day away.
With code its different.
I've tried all sorts of things but I always get something like
"Subscript out of range".
I hope somebody can help me out!
Thanks in advance, Hans Riis
I can control my date hierachy on my category axis in a chart with the
following code (always shows the last 25 days).
objPFS = ChartSpace1.InternalPivotTable.ActiveView.FieldSets("Date");
objPC = ChartSpace1.InternalPivotTable.Constants;
objPFS.AllIncludeExclude = objPC.plAllInclude;
objPFS.AllIncludeExclude = objPC.plAllExclude;
objPF = objPFS.Fields("Date");
var theDates = Array();
for(i=25 - 1;i>=0;i--) {
var DagsDato = new Date();
DagsDato.setDate(DagsDato.getDate() - i );
var day = DagsDato.getDate();
var monthNumber = DagsDato.getMonth();
var month = monthToMonthString(monthNumber + 1);
var year = "" + DagsDato.getFullYear();
theDates = theDates.concat(Array(objPFS.Member.ChildMembers(year).ChildMembers(month).ChildMembers(day
- 1)));
}
objPF.IncludedMembers = theDates;
}
The problem arises when I only want to show year and month (one year
back). It's easy when done with drag and drop. Just toss Day away.
With code its different.
I've tried all sorts of things but I always get something like
"Subscript out of range".
I hope somebody can help me out!
Thanks in advance, Hans Riis