cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
View Original Published Thread

scriptable object of the current report

hogi
Level XII

Hi,

 

what is the best way to get the scriptable object of the current report?

 

If it's a Graph Builder Object, I can use

gb = Current Report()["Graph Builder"] << get scriptable object 

This is astonishingly robust - but just works for Graph Builder objects. It even works when the user changed the title.

 

If it no Graph Builder, I can try

so = Current Report()[Outline Box( 1 )] << get scriptable object

It will work if there is no Local Data Filter,
no Column Switcher [ah, Column Switcher is a ColumnSwitcherContextOutlineBox, no OutlineBox]
and no user define Dashboard [ah, the Dashboard is created via TabPageBoxes, not OutlineBoxes]

 

For the case with the Local Data Filter, I could check the title:

ob = Current Report()[Outline Box( 1 )];
If( (ob << Get Title) == "Local Data Filter",
	ob = Current Report()[Outline Box( 2 )]
);ob << get scriptable object;

This approach works only with English language setting and just if the user didn't change the title of the OutlineBox.

So, better check if the scriptable object if it is a data filter:

Try (so = Current Report()[Outline Box( 1 )] << get scriptable object;
if (Char(Head(so)) == "Data Filter[]" ,
so = Current Report()[Outline Box( 2 )] << Get Scriptable Object),
	Caption("failed to get a scriptable object") // user defined Dashboard
)

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User


Re: scriptable object of the current report

Use "@helpKey" XML attribute

Names Default To Here(1);

obs = Current Report() << XPath("//OutlineBox[@helpKey and not(@helpKey = 'Data Filter')]");
If(N Items(obs) > 0,
	obj = obs[1] << Get Scriptable Object;
	Show(obj);
);

Write();

XPath query might need additional modifications depending on where it has to work. Do note that with XPath you can run into issues where JMP's XPath query isn't able to handle the XML(How to enable XML_PARSE_HUGE for << XPath()? ).

-Jarmo

View solution in original post

4 REPLIES 4
jthi
Super User


Re: scriptable object of the current report

Use "@helpKey" XML attribute

Names Default To Here(1);

obs = Current Report() << XPath("//OutlineBox[@helpKey and not(@helpKey = 'Data Filter')]");
If(N Items(obs) > 0,
	obj = obs[1] << Get Scriptable Object;
	Show(obj);
);

Write();

XPath query might need additional modifications depending on where it has to work. Do note that with XPath you can run into issues where JMP's XPath query isn't able to handle the XML(How to enable XML_PARSE_HUGE for << XPath()? ).

-Jarmo
hogi
Level XII


Re: scriptable object of the current report

Ah, nice. Thanks.

txnelson
Super User


Re: scriptable object of the current report

The whole issue can become moot if rather than using 

 

Distribution(
	Continuous Distribution( Column( :height ), Process Capability( 0 ) ),
	Local Data Filter
);
ob = Current Report()[Outline Box( 1 )];
If( (so << Get Title) == "Local Data Filter",
	ob = Current Report()[Outline Box( 2 )]
);
ob << get scriptable object;

 

If the scriptable object is obtained when the platform is executed

ob = Distribution(
	Continuous Distribution( Column( :height ), Process Capability( 0 ) ),
	Local Data Filter
);

Even if the multiple platforms are run, and the scriptable object is referenced using the same JSL variable, a simple JMP list can be used to gather in the scriptable object, avoiding all of the confusion that Current Report() can bring.

Using sample data table Big Class the following script illustrates how obtaining the scriptable object at the point of execution bypasses the Current Report() issue

names default to here(1);
dt=current data table();
objectList = {};

dis = Distribution(
	Continuous Distribution( Column( :height ), Process Capability( 0 ) )
);
insert into(objectList, dis);

show(current report()[outlinebox(1)]<<get title);
ob = report(dis) << get scriptable object;
show(report(dis)<<get title);
show(report(dis)[outlinebox(1)]<<get title);

dis = Distribution(
	Continuous Distribution( Column( :height ), Process Capability( 0 ) ),
	Local Data Filter
);
insert into(objectList, dis);

show(current report()[outlinebox(1)]<<get title);
ob = report(dis) << get scriptable object;
show(report(dis)<<get title);
show(report(dis)[outlinebox(1)]<<get title);

show(report(objectList[1])<<get title, report(objectList[2])<<get title)

A Wish List item for a new function called

<< Get Current Report Scriptable Object

might be warrented

Jim
hogi
Level XII


Re: scriptable object of the current report

my main application:
A command to tune/interact with any "existing" report .
So, there is no chance to fill a list.

 


@txnelson wrote:

A Wish List item for a new function called

<< Get Current Report Scriptable Object

might be warrented

ok:
message: Get Current Report Scriptable Object 

ob & so -> corrected in the main post