Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Button to display current properties...

Status
Not open for further replies.

rheilman

Programmer
Dec 6, 2002
51
US
I'm working on a web page that contains a pivot table and pivot chart that were published from an Excel file. I'm working with the MicroSoft Office Web Components model to manipulate the published objects from their default state.

I've been using the OCW help file to get the list of PEMs for setting. Now I'm working at being able to take the current values of some of those objects and retaining them to pass to another web page as parameters, so that the Office Web Component objects on that page can be filtered on the same criteria as the page from which the user linked.

In my crawling efforts I'm trying to create a javascript button to "alert" me to the current value of certain properties while I'm interacting with the page.

Once I locate the values I wish to capture, I'm going to work on what it takes to pass those values along to the next page.

In using the different search phrases that I've tried, I've found no previous posts on this.

Thanks in advance!
Ray <><

"I was going to change my shirt, but I changed my mind instead." - Winnie the Pooh
 
So what is it that you actually want to know? How to do an alert, or how to read the properties from the ActiveX components, both, or something else entirely?

To do an alert, use:

Code:
alert('some value here');

To get values, you'd probably need to script the specific ActiveX control you are using, and use any methods of that control. Without seeing code, or knowing the exact control(s) you are using, it would be pointless to speculate.

Hope this helps,
Dan


[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Thanks Dan,

I'll clarify...

I'm relatively new to javascript, but a coworker has me checked off on using alert. I've been able to identify the methods and properties of the control from the Microsoft Office Web Components object models in the help file.

The web page that I'm working with has a large section in the body that was generated by publishing a pivot table and pivot chart from Excel. That section is rather unformatted and gets overwritten every time the Excel file gets republished. Excel also publishes with certain properties defaulting to values other than what they were when being viewed in Excel.

For this reason I wanted to add some javascript code after the published section of the page. I have gotten references to the objects I need to manipulate using...

var pc = document.getElementById('Book1_24147_Chart');
var pt = document.getElementById('Book1_24147_PivotTable');

I can display the properties that I've found so far in a series of alerts as the page initially draws. What I want to do is to see how properties change with the interactive use of the Office Web Components.

I'm trying to code a button whose OnClick method displays the current value of the property that I've coded into the alert. For now it's just a research tool, so that I can learn what goes on in the component element as the user interacts with the pivot chart and pivot table.

Once I find the properties that count, I want to be able to pass those values to another page that I link to, and set the filters of that second page, based on the current filtering of the previous page. I don't specifically know how to do this, but I can't even start to do it until I know the values I need to pass.

One method of passing that has been suggested to me by a fairly non web programming person is to write the values out as cookies and then read them from the page that I link to.

Sorry for the long post, but that's the place where I'm heading.

Thanks!
Ray <><

"I was going to change my shirt, but I changed my mind instead." - Winnie the Pooh
 
I now have a button that is functioning in the way I described. It is produced by the code below.

<HTML>
<TITLE></TITLE>
<BODY>
<!--standard body stuff>
<javascript>
<!--code to set property values on load>
</javascript>
<FORM>
<INPUT type="button"
value="Property Value"
name="TheButton"
onClick="var pt =
document.getElementById('Book1_24147_PivotTable');
pv = pt.ActiveView;
pa = pv.FilterAxis;
fs = pa.FieldSets('[TCNs]');
fld = fs.Fields('[TCNs].[Site]');
alert(fs.AllIncludeExclude);
return true">
</FORM>
</BODY>
</HTML>

I just need to investigate the pivot objects and find out what properties change as the interactive filtering is done. I'm still looking for advice on the method to pass the values to the next page, but will probably post that under the specific topic label later.

Thanks!
Ray <><

"I was going to change my shirt, but I changed my mind instead." - Winnie the Pooh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top