PivotTable bug with custom groups ?

P

Pedro Mendoza

Hi,

While trying to implement a custom drillthrough, I had found an strange
behaviour in the way the PivotTable report the structure of the custom
groups level's members

Basically, if you query the structure of a custom group level's members
directly from a cell's corresponding row (or column) member is not the
same as querying it via its FieldSet

Using the attached code (OWC10's PivotTable against a localhost
FoodMart 2000 database), is possible to reproduce this strange
behaviour

The following steps should be follow:

1) Drop any measure in the data area
2) Drop any dimension (e.g. Promotions) in the row area
3) Create a custom group including some dimension members
4) Collapse the dimension so the only level displayed is the
just-created custom level
5) Double click on a data area cell corresponding to any of the members
in the just-created custom level
6) A popup will appear showing the UniqueName (computer generated) of
the selected member in the row area and the numbers of children members
this member has

Up to this point everything is okay, but now ...

7) Move the dimension to the page (filter) area
8) Filter the dimension excluding a member at the just-created custom
level
9) Repeat step 5) and the same popup as in 6) will appear but now the
numbers of children members reported will be 0

And that's the problem, is something wrong with the way I am accesing
the members (via their corresponding Field's FieldSet) or it is in fact
a bug ?

Many thanks in advance and sorry for the long post,
Pedro

--- start html code ---

<html>

<body>
<script language="jscript">
function VB2JS(arrayVB) {
return VBArray(arrayVB).toArray();
}

function getFullMember(member) {
var result = "", l;

// if total, upper member
if (member.IsTotal)
member = member.ParentMember;

// if group, union of lower members
if (member.CustomGroupType != 1) {
alert(member.UniqueName + " has " + member.ChildMembers.Count +
" children");
for (l = 0; l <= member.ChildMembers.Count - 1; l++) {
result += getFullMember(member.ChildMembers(l));
}
} else {
result = member.UniqueName + "|";
}

return result;
}

function getFieldSetFilter(fieldset) {
var j, k;

// abort if no filter
if (fieldset.AllIncludeExclude == 0)
return;

for (j = 0; j <= fieldset.Fields.Count - 1; j++) {
if (fieldset.Fields(j).IncludedMembers != null) {
includedMembers = VB2JS(fieldset.Fields(j).IncludedMembers);
for (k = 0; k <= includedMembers.length - 1; k++) {
getFullMember(includedMembers[k]);
}
}
if (fieldset.Fields(j).ExcludedMembers != null) {
excludedMembers = VB2JS(fieldset.Fields(j).ExcludedMembers);
for (k = 0; k <= excludedMembers.length - 1; k++) {
getFullMember(excludedMembers[k]);
}
}
}
}
</script>

<script language="jscript" for="PivotTable1" event="DblClick()">
table = window.document.getElementById("PivotTable1");
selection = table.selection;
if ((selection != null) && (table.SelectionType ==
"PivotAggregates")) {
cell = selection.Item(0).Cell;

// rows
row = cell.RowMember;
if (row.Field != null) {
getFullMember(row);
}

// pages
for (i = 0; i <= table.ActiveView.FilterAxis.FieldSets.Count - 1;
i++) {
fieldset = table.ActiveView.FilterAxis.FieldSets(i);
getFieldSetFilter(fieldset);
}
}
</script>
<br>
<form name="form1" action="generateSQL.asp" method="post">
<div align=center x:publishsource="Excel">
<object id="PivotTable1"
classid="CLSID:0002E552-0000-0000-C000-000000000046">
<param name="XMLData" value="&lt;!--[if gte mso 9]&gt;&lt;xml
xmlns:eek:=&quot;urn:schemas-microsoft-com:eek:ffice:eek:ffice&quot;

xmlns:x=&quot;urn:schemas-microsoft-com:eek:ffice:excel&quot;

xmlns:html=&quot;http://www.w3.org/TR/REC-html40&quot;&gt;

&lt;WorksheetOptions
xmlns=&quot;urn:schemas-microsoft-com:eek:ffice:excel&quot;&gt;

&lt;DefaultColWidth&gt;10&lt;/DefaultColWidth&gt;

&lt;Zoom&gt;0&lt;/Zoom&gt;
&lt;Panes&gt;

&lt;Pane&gt;
&lt;Number&gt;3&lt;/Number&gt;

&lt;ActiveRow&gt;3&lt;/ActiveRow&gt;

&lt;ActiveCol&gt;1&lt;/ActiveCol&gt;

&lt;/Pane&gt;
&lt;/Panes&gt;

&lt;ProtectContents&gt;False&lt;/ProtectContents&gt;

&lt;ProtectObjects&gt;False&lt;/ProtectObjects&gt;

&lt;ProtectScenarios&gt;False&lt;/ProtectScenarios&gt;

&lt;/WorksheetOptions&gt;
&lt;PivotTable
xmlns=&quot;urn:schemas-microsoft-com:eek:ffice:excel&quot;&gt;

&lt;PTSource&gt;

&lt;DataMember&gt;Sales&lt;/DataMember&gt;

&lt;CacheIndex&gt;1&lt;/CacheIndex&gt;

&lt;VersionLastRefresh&gt;2&lt;/VersionLastRefresh&gt;

&lt;RefreshName&gt;pedro.mendoza&lt;/RefreshName&gt;

&lt;RefreshDate&gt;2005-04-26T19:11:56&lt;/RefreshDate&gt;

&lt;RefreshDateCopy&gt;2005-04-26T19:11:56&lt;/RefreshDateCopy&gt;

&lt;NoSaveData/&gt;
&lt;CubeSource/&gt;

&lt;QuerySource&gt;

&lt;QueryType&gt;OLEDB&lt;/QueryType&gt;

&lt;CommandText&gt;Sales&lt;/CommandText&gt;

&lt;CommandType&gt;Cube&lt;/CommandType&gt;

&lt;Maintain/&gt;

&lt;Connection&gt;Provider=MSOLAP.2;Persist Security Info=True;Data
Source=localhost;Initial Catalog=FoodMart 2000;Client Cache
Size=25;Auto Synch Period=10000;Large Level
Threshold=10&lt;/Connection&gt;

&lt;RobustConnect&gt;0&lt;/RobustConnect&gt;

&lt;VersionLastEdit&gt;2&lt;/VersionLastEdit&gt;

&lt;VersionLastRefresh&gt;2&lt;/VersionLastRefresh&gt;

&lt;/QuerySource&gt;
&lt;/PTSource&gt;

&lt;Name&gt;Table&lt;/Name&gt;

&lt;DataMember&gt;Sales&lt;/DataMember&gt;

&lt;ImmediateItemsOnDrop/&gt;

&lt;ShowPageMultipleItemLabel/&gt;

&lt;VisualTotals/&gt;

&lt;Location&gt;$A$1:$E$6&lt;/Location&gt;

&lt;VersionLastUpdate&gt;2&lt;/VersionLastUpdate&gt;

&lt;DefaultVersion&gt;1&lt;/DefaultVersion&gt;

&lt;/PivotTable&gt;
&lt;/xml&gt;&lt;![endif]--&gt;">
</object>
</div>
<br>
</form>
</body>

</html>

--- end of html code ---
 

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