scriptable object of the current reportHi,
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 )]
);<BR />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
)
Automation and ScriptingRe: scriptable object of the current reportUse "@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()? ).
Re: scriptable object of the current reportAh, nice. Thanks.
Re: scriptable object of the current reportThe 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=""></GET>
A Wish List item for a new function called
<< Get Current Report Scriptable Object
might be warrented
Re: scriptable object of the current reportmy 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