Subscribe Bookmark RSS Feed

Saving multiple pngs in one journal

tylerram93

Contributor

Joined:

Jul 20, 2017

I have code that creates many distributions given the reticle and wafer and was wondering how to save it in one report? Right now it only saves the first picture!

 

Thanks for all the help!

 

bivDistribution = Distribution( by(Column_Wafer,Column_Reticle),

Y( Eval(Column_MaxIc) ),

X( Eval(Column_Area) ),

);

bivDistribution << Save Journal("Example.jrn", jrn);

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Craige_Hales

Staff

Joined:

Mar 21, 2013

Solution

The by goup makes JMP produce a list of reports. When you send a message to a list, the message is applied to each item in the list. In the original example, all of the reports were journalled, one at a time, and each one over-wrote the previous, leaving only the final report. There is a parent box holding all of the reports, and that is what needs to be journalled.

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dist = dt << Distribution( Y( :weight ), By( :age ) );
// dist is a list of reports: 
// {Distribution[], Distribution[], Distribution[], Distribution[], Distribution[], Distribution[]}
dist rep = dist << Report;
// dist rep is a list of displayboxes:
// {DisplayBox[OutlineBox], DisplayBox[OutlineBox], DisplayBox[OutlineBox], DisplayBox[ OutlineBox], DisplayBox[OutlineBox], DisplayBox[OutlineBox]}
// the parent box of any of the boxes is the container for all of the boxes, and
// that parent is what you want to journal. [1] should be a good choice to find the parent.

(dist rep[1]<<parent) << Save Journal( "$temp/x.jrn","jrn" );

open("$temp/x.jrn")

I forgot to add the [1] the first time I did this, and it works...slowly. It used all of the reports, one at a time, to find the parent and journal all of the reports. By adding the [1], the list becomes a single report and it goes much faster.

Craige
Craige_Hales

Staff

Joined:

Mar 21, 2013

Solution

status appears to be a list with one element, and at the end, maybe two elements. It looks like you are trying to read the 2nd element before it is created. NItems(status) will tell you how many items are in the list.

Craige
6 REPLIES
markbailey

Staff

Joined:

Jun 23, 2011

You need to send the Save Journal() message to the report layer of the platform, not the analysis layer. Like this:

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

dist = dt << Distribution( Y( :weight ), By( :age ) );

dist rep = dist << Report;

dist rep << Save Journal( "desired path" );
Learn it once, use it forever!
Craige_Hales

Staff

Joined:

Mar 21, 2013

Solution

The by goup makes JMP produce a list of reports. When you send a message to a list, the message is applied to each item in the list. In the original example, all of the reports were journalled, one at a time, and each one over-wrote the previous, leaving only the final report. There is a parent box holding all of the reports, and that is what needs to be journalled.

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dist = dt << Distribution( Y( :weight ), By( :age ) );
// dist is a list of reports: 
// {Distribution[], Distribution[], Distribution[], Distribution[], Distribution[], Distribution[]}
dist rep = dist << Report;
// dist rep is a list of displayboxes:
// {DisplayBox[OutlineBox], DisplayBox[OutlineBox], DisplayBox[OutlineBox], DisplayBox[ OutlineBox], DisplayBox[OutlineBox], DisplayBox[OutlineBox]}
// the parent box of any of the boxes is the container for all of the boxes, and
// that parent is what you want to journal. [1] should be a good choice to find the parent.

(dist rep[1]<<parent) << Save Journal( "$temp/x.jrn","jrn" );

open("$temp/x.jrn")

I forgot to add the [1] the first time I did this, and it works...slowly. It used all of the reports, one at a time, to find the parent and journal all of the reports. By adding the [1], the list becomes a single report and it goes much faster.

Craige
tylerram93

Contributor

Joined:

Jul 20, 2017

Your solution worked beautifully! Now I am trying to implement it into a
GUI I made where it reads in a datatable and was hoping you could help with
the error it gives me!

Thanks for your expertise!

This is the error: "Subscript Range in access or evaluation of 'Subscript'
, status[/*###*/2]"

//Call CreateBivariate to do a bivariate (two variable) analysis

//list allows you to do more analysis

status = List*(0)*;

New Window*(*"Analysis for MaxIc Vs. Corrected Area",

H List Box*(*

V List Box*(*;

Panel Box*(*"Controls",

Text Box*(*"Choose Analysis"*)*,

choice = Check Box*({*"Distribution for Current Vs. Area with", "Generate
Report"*}*,

current = choice << *Get(1)*;

xParam = Column_Area; //Corrected Area

yParam = Column_MaxIc; //Max Ic

x1Param = Column_NomArea; // Nominal Area

y1Param = Column_InverseRes;

//Get the distribution

If*(* And*(* current, Not*(*status*[**1]* *)* *)*,

dt << *Append(*

dt = V List Box*(*

bivDistribution = Distribution*(* by*(*Column_Wafer,Column_Reticle*)*,

Y*(* Eval*(*yParam*)* *)*,

X*(* Eval*(*xParam*)* *)*,

*)*;

*)*

*)*;

status*[**1]*=*1*; //mark as present

*)*;

current = choice << *Get(2)*;

//Get the distribution

If*(* And*(* current, Not*(*status*[**2]* *)* *)*,

dt << *Send to Report(*

//This is the report for the distribution of the Max Ics versus the
Corrected Area

bivDistribution = Distribution*(* by*(*Column_Wafer,Column_Reticle*)*,

Y*(* Eval*(*yParam*)* *)*,

X*(* Eval*(*xParam*)* *)*,

*)*;

*)*;

//dist_report = bivDistribution << Report;

//(dist_report << parent) <Sandbox\Gingrich\69977JM\MaxIc_CorArea.jrn") ) ;

*(*dt << *parent)* <<*Save Journal**((*"Example.jrn"*)* *)* ;

status*[**2]*=*1*; //mark as present

*)*;

*)*

*)*

*)*,

dt = V List Box*()*,

*)*

*)*;


Craige_Hales

Staff

Joined:

Mar 21, 2013

Solution

status appears to be a list with one element, and at the end, maybe two elements. It looks like you are trying to read the 2nd element before it is created. NItems(status) will tell you how many items are in the list.

Craige
tylerram93

Contributor

Joined:

Jul 20, 2017

Now it gives me this error?

Send Expects Scriptable Object in access or evaluation of 'Send' , (dt <<
parent[1]) << /*###*/Save Journal(
"T:\W\Wintermute\50 Sandbox\Gingrich\69977JM\MaxIc_CorArea.jrn"
) /*###*/
Craige_Hales

Staff

Joined:

Mar 21, 2013

<< is the JSL send operator. It is used to send a message, like the Save Journal message, to an object that can be scripted (a scriptable object). The part of your code to the left of << is not a scriptable object.  Usually, dt would be a data table. I don't think data tables understand a parent message. And messages would never be subscripted with square brackets.

Note that you have two send operators. The second one is complaining, but the first one needs to be fixed before the 2nd one can have a chance to work. Currently the dt object is ignoring a message it doesn't understand.

Use 

show(dt); 

before the statement that fails and look in the log window to get some idea of what is going on.

Craige