Capture RowMember Drill Down value...

R

RayTheOtherRay

<script language='javascript'
for=My_PivotTable
event=SelectionChange()>
var pt = document.getElementById('My_PivotTable');
var pd = pt.ActiveData;
var ra = pd.RowAxis;
if (pt.SelectionType == 'PivotRowMembers')
{alert(ra.RowMember.Axis.Label.Caption);}
</script>

Based on the code above, I have a PivotTable where there is only one
FieldSet in the RowAxis of the PivotData object. When I hover over a
cell in the Totals columns of the PivotTable, the ToolTips box displays
a number of facts about the hovered-over cell. Among those facts is
something labeled 'Row Member:'. This contains a string that show the
succession of drilling down that pertains to the row over which the
pointer is hovering.

I'd like to be able to capture this string and write it to a cookie to
be applied to the FilterAxis of another published PivotTable page. The
"alert" above yields "undefined." So far ra.RowMember is a valid
object. The Axis property also references a valid object, as does the
Label property.

I need the appropriate combination of objects and properties to capture
this. Once I have that combination, I'll replace the alert with code
to put the captured string in form that can be placed into the
IncludedMembers property on the other page.

Thanks!
Ray <><
 
R

RayTheOtherRay

It's me, again, with an answer to my own question. Since the above
post, I've altered the script to be used for the DblClick event. This
allowed me to work on the page without disturbing those who just wanted
to look and not willfully double click.

I found that instead of the cells in the PivotTable in which I am
interested being of SelectionType = 'PivotRowMembers', they are
'PivotAggregates'. Once I found that, I traced further objects and
properties through the model and came up with...

var myvalue = pt.Selection.Item(0).Cell.RowMember.UniqueName;

If the item upon which I double click is of SelectionType =
'PivotAggregate', then to drill down to the actual item selected, I
used the Item(0) property. This references the first (and only, in
this case) item in the selection. The Cell property gives a reference
to the DetailCell object. The RowMember property refers to the
RowMember of the current row in the RowAxis. The UniqueName property
gives the drill down path of the RowMember instead of just the value at
the end of the drill down path. This is exactly the information that I
was looking for.

In trying to use it in a cookie file, I ran into some other issues that
are for another forum. It took me a while to find this, so I post it
in the hope that it will be useful to someone else.

Thanks!
Ray <><
 

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