I would like to use JSL to get a reference to a selected report element. More specifically. I want
a) run a report
b) manually select a report element
c) then run a JSL command to get the display box path to that selected report element.
Any ideas on how to do this?
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
So we are looking for selected attribute with value of true and then it is just figuring out the query.
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.
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
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
So we are looking for selected attribute with value of true and then it is just figuring out the query.
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.
Exactly what I needed! Thanks.