Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
AndresGlez
Level III

Customized report Help

Hi there, just in a different post of missing outlines in report @danschikore helped me with a report I used to generate, hope you help me again. Below is the complete script I use (in fact I need to generate 2 reports), that is why I used to cut in pieces the generated reports and then glue them together.

The way you helped me fix the first report was excellent, now I am wondering, what is the best approach to do it as I need to generate 2 separate reports?

First is exactly as the one you generated and Second is only the Variances Test result. Below is the whole script I did. Let me know what approach I should follow to separate them as in my example for 2 reports. Thank you!!!

 

Open("$SAMPLE_DATA/Animals.jmp");
biv = DATA TABLE ( "Animals")
<< Oneway(
Y( :miles ),
X( :season ),
All Pairs( 1 ),
With Control( 1, {"fall"} ),
Quantiles( 1 ),
Means and Std Dev( 1 ),
Unequal Variances( 1 ),
Box Plots( 1 ),
Mean Error Bars( 1 ),
Std Dev Lines( 1 ),
Connect Means( 1 ),
X Axis Proportional( 0 ),
Points Jittered( 1 ),
Grand Mean( 0 ),
SendToReport(

Dispatch(
{},
"Oneway Plot",
FrameBox,
{DispatchSeg(
Box Plot Seg( 1 ),
{Confidence Diamond( 0 ), Line Color( "Red" )}
), DispatchSeg(
Box Plot Seg( 2 ),
{Confidence Diamond( 0 ), Line Color( "Red" )}
), DispatchSeg(
Box Plot Seg( 3 ),
{Confidence Diamond( 0 ), Line Color( "Red" )}
), DispatchSeg(
Box Plot Seg( 4 ),
{Confidence Diamond( 0 ), Line Color( "Red" )}
), Row Legend(
season,
Color( 1 ),
Color Theme( "JMP Default" ),
Marker( 0 ),
Marker Theme( "" ),
Continuous Scale( 0 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
),
Dispatch(
{"Means Comparisons", "Comparisons for all pairs using Tukey-Kramer HSD"
},
"Ordered Differences Report",
OutlineBox,
{Set Title( "Means Comparisons Report" )}
),
Dispatch(
{},
"Tests that the Variances are Equal",
OutlineBox,
{Set Title( "Tests that the Variances are Equal" )}
)
)
);
reportbiv = biv << report;
chart1 = reportbiv [Outline Box(1)][Axis Box( 1 )] << get picture; // Y Axis
chart2 = reportbiv [Outline Box(1)][List Box( 3 )] << get picture; //Chart
chart3 = reportbiv [Outline Box(1)][List Box( 5 )] << get picture; // Donuts
chart4 = reportbiv [Outline Box(1)][table Box( 1 )] << get picture; // Conditions
chart5 = reportbiv [Outline Box("Quantiles")] << get picture; // Quantiles
chart6 = reportbiv [Outline Box("Means and Std Deviations")] << get picture; // Means and Std Dev
chart7 = reportbiv [Outline Box("Means Comparisons Report")] << get picture; // Means Comparison
chart8 = reportbiv [Outline Box(13)] << get picture; // Variances
biv1 = New Window( "Report",
V List Box(OutlineBox( "Oneway Analysis of Animals", TextBox("",<<SetWidth(535)), ... ),
H List Box(
Table Box( chart1 ),
Table Box( chart2 ),
Table Box( chart3 ),
Table Box( chart4 )),
Table Box( chart5 ),
Table Box( chart6 ),
Table Box( chart7 )
));
biv1 << save picture ( "$DOCUMENTS\ANOVA Animals.png", png );
//biv 1 << Close Window;biv1
biv2 = New Window( "Report",
Outline Box( "", Table Box( chart8 ) ));
biv2 << save picture ( "$DOCUMENTS\Variances Animals.png", png );
//biv 1 << Close Window;

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Customized report Help

In your second example, you clone a display tree starting at an Outline Box, and that works just fine.  You could do the same thing with the first report, cloning the tree (either completely or in parts) and then applying the customizations.

 

The difficulty with converting boxes to images is that some boxes depend on their surroundings in ways that could be lost after the copy.  For example, axis labels may extend beyond the bounds of the box:

Untitled.png

 

Axes and Frames are also arranged carefully to make sure that they are lined up correctly - converting to images and gluing together may affect this alignment.

 

Other examples are things like adjacent border boxes, which will share an edge and produce a single-line at the shared border.  If you take an image of just one of those boxes, you may find that an edge is not drawn.

 

For these reasons I prefer to manipulate the boxes to produce a custom report, rather than assembling a collection of images.  Your second example, cloning a portion of the report into a new window, is a great way to do that.

 

 

View solution in original post

3 REPLIES 3
Highlighted
txnelson
Super User

Re: Customized report Help

If I am understanding your question accurately, you have a need to convert the Variances section of code into a picture object so you can save it as a .png file like you did for your first report.  You are generating a second report with the variance......what is wrong with the report?  The only real difference between report 1 and report 2 is that in Report 1 took subcomponents from an area of the Oneway report and put them back together underneath a new Outline Box(), where in Report 2, you have just taken everything under the Variances outline box from the Oneway report and copied it as a picture object into a new display window.  If you could provide more detail on what the issue is, the Community might be able to help.

Jim
Highlighted

Re: Customized report Help

In your second example, you clone a display tree starting at an Outline Box, and that works just fine.  You could do the same thing with the first report, cloning the tree (either completely or in parts) and then applying the customizations.

 

The difficulty with converting boxes to images is that some boxes depend on their surroundings in ways that could be lost after the copy.  For example, axis labels may extend beyond the bounds of the box:

Untitled.png

 

Axes and Frames are also arranged carefully to make sure that they are lined up correctly - converting to images and gluing together may affect this alignment.

 

Other examples are things like adjacent border boxes, which will share an edge and produce a single-line at the shared border.  If you take an image of just one of those boxes, you may find that an edge is not drawn.

 

For these reasons I prefer to manipulate the boxes to produce a custom report, rather than assembling a collection of images.  Your second example, cloning a portion of the report into a new window, is a great way to do that.

 

 

View solution in original post

Highlighted
AndresGlez
Level III

Re: Customized report Help

Thank you @danschikore , with the solution you gave me for the first report and your feedback about how second report is properly created starting from the Outline Box, I can create the reports as I want. 

I will modify my scripts to follow your solution and play around with the scripts to practice and understand deeper how to report specific parts.

Thank you again your support was excellent.

Article Labels

    There are no labels assigned to this post.