cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
shampton82
Level VII

Loop through "SendToReport" element in process screener

Hey everyone,

I am trying to loop though a Proces Screener script that makes the "Charts as selected" report element.  I need it to be flexible as the number of Reponses in the screener can change over time.  So I tried putting in this loop to change the axis format of the charts but alas it does not work.

 

	SendToReport(
		Dispatch( {}, "", TableBox, {Sort By Column( 2, 1 )} ),
		Dispatch( {}, "Charts as Selected", OutlineBox, {Close( 1 )} ),
		For( i = 1, i <= 422, i++,
			Dispatch(
				{"Charts as Selected"},
				"1",
				ScaleBox(i),
				{Format( "m/d/y", 10 ), Min( 3784397666.7875 ), Max( 3787415686.74375 ), Interval( "Week" ), Inc( 1 ), Minor Ticks( 6 ),
				Label Row( {Label Orientation( "Perpendicular" ), Show Major Grid( 1 )} )}
			),
			Dispatch( {"Charts as Selected"}, "ProcessScreening Graph As Selected", FrameBox( i ), {Frame Size( 602, 255 )} ),
		)
		
	)

this is a section of code that show the repetition I am trying to loop over

SendToReport(
		Dispatch( {}, "", TableBox, {Sort By Column( 2, 1 )} ),
		Dispatch({"Charts as Selected"},
			"1",
			ScaleBox,
			{Min( 3784397666.7875 ), Max( 3787415686.74375 ), Interval( "Week" ), Inc( 1 ), Minor Ticks( 6 ),
			Label Row( {Label Orientation( "Perpendicular" ), Show Major Grid( 1 )} )}
		),
		Dispatch( {"Charts as Selected"}, "ProcessScreening Graph As Selected", FrameBox, {Frame Size( 602, 255 )} ),
		Dispatch(
			{"Charts as Selected"},
			"1",
			ScaleBox( 2 ),
			{Min( 3784397666.7875 ), Max( 3787415686.74375 ), Interval( "Week" ), Inc( 1 ), Minor Ticks( 6 ),
			Label Row( {Label Orientation( "Perpendicular" ), Show Major Grid( 1 )} )}
		),
Dispatch( {"Charts as Selected"}, "ProcessScreening Graph As Selected", FrameBox( 2 ), {Frame Size( 602, 255 )} ),

Any guidance would be appreciated!

 

Steve

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Loop through "SendToReport" element in process screener

Without knowing what you are really trying do, I would suggest that you modify them after selections have been done by getting references to those axis (scaleboxes) using << XPath and then modifying that list by sending message(s) to that list.

 

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");
obj = dt << Process Screening(
	Process Variables(Column Group("Processes")),
	Grouping(:SITE),
	Control Chart Type("Indiv and MR"),
	Show Charts as Selected(1),
	RowStates([0 1, 171 1, 245 1])
);

scs = Report(obj) << XPath("//ScaleBox");
xaxis_idx = 2::N Items(scs)::3;
scs[xaxis_idx] << Min(-100) << Max(400) << Inc(100) << Inc(100) << Minor Tics(2);
-Jarmo

View solution in original post

4 REPLIES 4
jthi
Super User

Re: Loop through "SendToReport" element in process screener

Without knowing what you are really trying do, I would suggest that you modify them after selections have been done by getting references to those axis (scaleboxes) using << XPath and then modifying that list by sending message(s) to that list.

 

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");
obj = dt << Process Screening(
	Process Variables(Column Group("Processes")),
	Grouping(:SITE),
	Control Chart Type("Indiv and MR"),
	Show Charts as Selected(1),
	RowStates([0 1, 171 1, 245 1])
);

scs = Report(obj) << XPath("//ScaleBox");
xaxis_idx = 2::N Items(scs)::3;
scs[xaxis_idx] << Min(-100) << Max(400) << Inc(100) << Inc(100) << Minor Tics(2);
-Jarmo
shampton82
Level VII

Re: Loop through "SendToReport" element in process screener

Thanks @jthi !!

That worked great.  I ended up add in my stuff as so:

scs = Report(psobj) << XPath("//ScaleBox");
xaxis_idx = 2::N Items(cnames)::3;
scs[xaxis_idx] << Min(3784397666.7875) << Max(3787415686.74375) << Interval( "Week" ) << Inc( 1 ) << Minor Ticks( 6 )<<Label Row( {Label Orientation( "Perpendicular" )})<<Show Major Grid( 1 );

Quick question, how did you know to use Scalebox?  When I looked at the properties of the Process Screener I didn't see Scalebox called out.  When I clicked on the axis of the charts it said Axisbox.

jthi
Super User

Re: Loop through "SendToReport" element in process screener

This part told me that I could (at least try) to use ScaleBox

jthi_0-1704653882796.png

 

You could have also used AxisBox (it might be that in earlier JMP versions you would have had to use axisbox). Note that it has different start index

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");
obj = dt << Process Screening(
	Process Variables(Column Group("Processes")),
	Grouping(:SITE),
	Control Chart Type("Indiv and MR"),
	Show Charts as Selected(1),
	RowStates([0 1, 171 1, 245 1])
);

scs = Report(obj) << XPath("//AxisBox");
xaxis_idx = 3::N Items(scs)::3;
scs[xaxis_idx] << Min(-100) << Max(400) << Inc(100) << Inc(100) << Minor Ticks(2);

 

-Jarmo
shampton82
Level VII

Re: Loop through "SendToReport" element in process screener

Perfect, thanks!!