Get a jrp like script from a report windowHello everyone,
I am trying to save my report script to a jrp file as explained in: Save charts as ".jrp" file in JSL
However, I don't have direct access to the Graph Builder that generated my Report Window.
I'm getting my reports via
Get Window List(Type("Reports"));
And now I need to extract the script to save it as a text file, however I can't figure out how to get that script.
When using << Get Script I only end up with things like
GraphBuilderBox(ScaleBox(ParallelScaleBox(ScaleBox(ScaleBox(ScaleBox(ScaleBox(ScaleBox(ScaleBox(GraphBuilderContainerBox(Graph[...]
How do I get a text that's more like
Graph Builder(
Size( 1896, 975 ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Variables(...
?
Automation and ScriptingContent OrganizationMass CustomizationRe: Get a jrp like script from a report windowThanks @MikeD_Anderson! I agree, it would make a good addition.
Re: Get a jrp like script from a report windowThis little nugget should be in the JSL Cookbook! Thanks @txnelson ! @DonMcCormack
Re: Get a jrp like script from a report windowThank you very much, that did it!
Re: Get a jrp like script from a report windowThe "Get Window List" returns the Top Parent for the window.
The "Get Scriptable Object" is a message to an Outline Box(). Therefore, this modification should get you what you want.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
dis = Distribution( Continuous Distribution( Column( :height ) ) );
x = (Get Window List( Type( "Reports" ) )[1][Outline Box( 1 )] << get scriptable object());
x << get script;
Re: Get a jrp like script from a report windowInteresting. By doing it step by step like this:
wList = Get Window List(Type("Reports"));
rep = wList[1] << report;
so = rep << Get Scriptable Object();
skr = so << get script();
Print( skr ); I am now getting error messages that Object 'HeadBox' does not recognize the message 'report'; as well as Object 'HeadBox' does not recognize the message 'Get Scriptable Object'; if I cut the report message. So Get Window List(Type("Reports")); gets me a headbox that can only recognize Get Script, which in turn gives me the same old
HeadBox(V List Box(Box(OutlineBox(H List Box(NoCloneBox(IfBox(H List Box
I already learned something, but I'm still not there yet. How do I get the Scriptable Object of my window?
Re: Get a jrp like script from a report windowIt could be that your messages in:
print(wList[1] << report << Get Scriptable Object() << get script());
aren't being executed in the order you think they are.
Compare the results of these two:
Names Default To Here( 1 );
Open( "$SAMPLE_DATA/Big Class.jmp" );
biv = bivariate( y( :weight ), x( :height ) );
rbiv = biv << report;
Print( (rbiv << Get Scriptable Object()) << get script() );
Print( rbiv << Get Scriptable Object() << get script() );
Re: Get a jrp like script from a report windowThank you for the reply. However I didn't manage to solve my issue yet.
After opening an existing .jrp file, which in turn opens a data table and a report window, the following scripts:
wList = Get Window List(Type("Reports"));
print(wList[1] << report << Get Scriptable Object() << get script());wList = Get Window List(Type("Reports"));
print(wList[1] << Get Scriptable Object() << get script());will both result in
HeadBox(V List Box(Box(OutlineBox(H List Box(NoCloneBox(IfBox(H List Box(V List Box(H List Box(ButtonBox, ButtonBox, ButtonBox), BorderBox(V List Box(H List Box(PopupBox, Text Box("40 Columns")), V List [... etc.]Not the kind of script I am looking for. This seems to be a special case, since I'm starting with an existing report window. What am I doing wrong?
Re: Get a jrp like script from a report windowTake a look at the Get Scriptable Object() message. You can use that to get access to the platform (i.e., Graph Builder) in a report.
Names Default To Here( 1 );
Open( "$SAMPLE_DATA/Big Class.jmp" );
biv = bivariate( y( :weight ), x( :height ) );
rbiv = biv << report;
bivobj = rbiv << Get Scriptable Object();
bivobj<<GET script=""></GET>