...

View Full Version : Format embedded excel object in powerpoint using javascript



josna
09-16-2005, 07:50 PM
New to this forum please help...

Here is the situation -- I have a Powerpoint report generated from Brio (Hyperion Intelligence), This PPT report has lots of gra[hs and charts embedded in it. Now we are working on the formating of these embededded objects...Brio uses Java Script to communicate to these objects but there are some limitations that it is not able to go superscript a part of the datalabel of the embedded chart in powerpoint.

Now the solution we thought is may be we can write an external script indepedent of brio that is called from brio and that will actually work on the active presentation on the system....that will go loop through the slides check for embedded excel objects in active powerpoint application and then go check and see if that chart has datalabels and then superscript the last 2 charecters of the datalabel...

Seems like round about solution but I kind of have a hunch that it is possible... How? i donot know, need expert help here

Please help me....
Thanks

rm-f
09-16-2005, 10:22 PM
Post some short example that you have problem with. Maybe someone would be able to help you.

josna
09-21-2005, 08:52 PM
Here is the code below... FYI I am tring to work with this for the first time... I am not very familier with Java script &/ BRio. Brio is the tool that I am using to execute this code in... There are some known limitation to how much brio can interpret is my understanding, but if some one could change the code in red to javascript I will take it from there.


var ADS = ActiveDocument.Sections;
var ADS_RSU_S = ADS["Dashboard"].Shapes;

var rCI = ADS_RSU_S["CiLabel"].Text;

Console.Writeln(rCI);

var oPPT = new JOOLEObject("PowerPoint.Application");
oPPT.Visible = true;

var oPPTPres = oPPT.Presentations.Open(sFile);
oPPT.ActiveWindow.ViewType = 1;

oPPT.ActiveWindow.View.GotoSlide(13);

var myDocument = oPPT.ActiveWindow.Selection;

//myDocument.SlideRange.Shapes.Item("Text Box 3").TextFrame.TextRange.Text = rCI;
var txtRng = myDocument.SlideRange.Shapes.Item("Text Box 3").TextFrame.TextRange;

var foundText = txtRng.Find("95%");
foundText.Font.Bold = 1;
//txtRng.Replace(Findwhat := "95%", Replacewhat := "90%");

Do While Not oTmpRng Is Nothing
Set oTxtRng = oTxtRng.Characters(oTmpRng.Start + oTmpRng.Length, _
oTxtRng.Length)
Set oTmpRng = oTxtRng.Replace(FindWhat:="like", _
Replacewhat:="NOT LIKE", WholeWords:=True)

This code above is what i want ot change to Javascript code... I have tried by doing the following ( commented out line ) above in Green

Up to the green commented statement the code works perfectly... Please some one help me..

felgall
09-22-2005, 12:43 AM
That code definitely isn't Javascript. It might be JScript.

TNO
09-22-2005, 01:06 PM
Do While Not oTmpRng Is Nothing
Set oTxtRng = oTxtRng.Characters(oTmpRng.Start + oTmpRng.Length, _
oTxtRng.Length)
Set oTmpRng = oTxtRng.Replace(FindWhat:="like", _
Replacewhat:="NOT LIKE", WholeWords:=True)

The Above VBScript can be roughly translated as shown:


while (oTmpRng!=""){
var oTxtRng = oTxtRng.Characters(oTmpRng.Start + oTmpRng.Length,
oTxtRng.Length);
var oTmpRng = oTxtRng.Replace(FindWhat:="like",Replacewhat:="NOT LIKE", WholeWords:=True);
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum