cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Register to attend Discovery Summit 2025 Online: Early Users Edition, Sept. 24-25.
  • New JMP features coming to desktops everywhere this September. Sign up to learn more at jmp.com/launch.
Choose Language Hide Translation Bar
MathStatChem
Level VII

Get display box reference for selected item in report

I would like to use JSL to get a reference to a selected report element.  More specifically.  I want 

 

a) run a report

MathStatChem_0-1754425955232.png

 

b) manually select a report element

MathStatChem_1-1754426045135.png

c) then run a JSL command to get the display box path to that selected report element.

 

Any ideas on how to do this?  

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Get display box reference for selected item in report

I have made XML/Report layer viewer which lets user pick elements and I use XPath with it. First use Get XML to get an idea what is possible

jthi_0-1754456992795.png

So we are looking for selected attribute with value of true and then it is just figuring out the query.

View more...
Names Default To Here(1); 

dt = Open("$SAMPLE_DATA/Big Class.jmp");
biv = dt << Run Script("Bivariate");

rep = Report(biv);


s = rep << XPath("//*[@selected='true']");

If(N Items(s) > 0,
	ref = s[1];
,
	ref = Empty();
);

sub_path = ref << Get Display Path(rep,  Mode("Subscript"));
// biv["Bivariate Fit of weight By height", "Linear Fit", "Summary of Fit", String Col Box(1)]

I would still suggest using Show Properties like Jim did demonstrate for basic use cases.

-Jarmo

View solution in original post

3 REPLIES 3
txnelson
Super User

Re: Get display box reference for selected item in report

You can do this by right clicking on the report and selecting 

     Show Properties

and then click on the display item you want to get the path to

and under the Box Path you will find the path to the element you have selected

txnelson_0-1754430051303.png

 

 

Jim
jthi
Super User

Re: Get display box reference for selected item in report

I have made XML/Report layer viewer which lets user pick elements and I use XPath with it. First use Get XML to get an idea what is possible

jthi_0-1754456992795.png

So we are looking for selected attribute with value of true and then it is just figuring out the query.

View more...
Names Default To Here(1); 

dt = Open("$SAMPLE_DATA/Big Class.jmp");
biv = dt << Run Script("Bivariate");

rep = Report(biv);


s = rep << XPath("//*[@selected='true']");

If(N Items(s) > 0,
	ref = s[1];
,
	ref = Empty();
);

sub_path = ref << Get Display Path(rep,  Mode("Subscript"));
// biv["Bivariate Fit of weight By height", "Linear Fit", "Summary of Fit", String Col Box(1)]

I would still suggest using Show Properties like Jim did demonstrate for basic use cases.

-Jarmo
MathStatChem
Level VII

Re: Get display box reference for selected item in report

Exactly what I needed!  Thanks.  

Recommended Articles