cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar

How to save picture by jsl

Hi, JMPer I want to use jsl to only save the Process Capability's histogram charts without any . Is there any way to achieve it?


CompleteLeopard_0-1699840025299.png

 

 

6 REPLIES 6
jthi
Super User

Re: How to save picture by jsl

If you just want those histograms and nothing else, it is most likely easiest to capture them one by one from distribution platform

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");

nw_collector = New Window("",
	vlb = V List Box()
);

cols = {"NPN1", "PNP1"};

For Each({col_name}, cols,
	dist = dt << Distribution(
		Stack(1),
		Continuous Distribution(
			Column(Eval(col_name)),
			Horizontal Layout(1),
			Vertical(0),
			Process Capability(Use Column Property Specs)
		)
	);

	lb = Report(dist)[OutlineBox(col_name || " Capability"), OutlineBox("Histogram"), ListBox(1)];
	pic = lb << Get Picture;
	vlb << Append( // use outlinebox to add title
		OutlineBox("Process Capability for " || col_name, pic)
	);
	dist << Close Window;	
);

Those images can be captured from Process Capability or from distribution when you have all of those open at the same time, but it is easier to navigate report layer this way.

jthi_0-1699854662779.png

 

-Jarmo
peng_liu
Staff

Re: How to save picture by jsl

Recently, I found that saving images to a data table can be useful in some use cases. Here is a modified version does that, based on @jthi 's example.

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");

cols = {"NPN1", "PNP1"};
outputdt = New Table( "imgs",
	Add Rows( nitems(cols) ),
	New Column( "image", Expression, "None", Set Values( {} ) ),
);

i = 1;
For Each({col_name}, cols,
	dist = dt << Distribution(
		Stack(1),
		Continuous Distribution(
			Column(Eval(col_name)),
			Horizontal Layout(1),
			Vertical(0),
			Process Capability(Use Column Property Specs)
		)
	);

	lb = Report(dist)[OutlineBox(col_name || " Capability"), OutlineBox("Histogram"), ListBox(1)];
	pic = lb << Get Picture;
	outputdt:image[i] = pic;
	i++;
	dist << Close Window;	
);

Re: How to save picture by jsl

Thank you very much.

But I had another question, after saving image to table, can export as excel file? I tried to do this, it was not shown as picture.

CompleteLeopard_0-1699926733917.png

 

peng_liu
Staff

Re: How to save picture by jsl

This not possible to my knowledge. Here are the reasons:

1) Images in Excel are not cell data. They are OLE objects, which you can think that images are attachments to the sheet. Images in JMP Data Table are cell data. So Excel and JMP see images differently.

2) Excel probably will never understand the meaning of images in JMP.

pmroz
Super User

Re: How to save picture by jsl

Here's how to export the report as an MS Word file.

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");

nw_collector = New Window("",
	vlb = V List Box()
);

cols = {"NPN1", "PNP1"};

For Each({col_name}, cols,
	dist = dt << Distribution(
		Stack(1),
		Continuous Distribution(
			Column(Eval(col_name)),
			Horizontal Layout(1),
			Vertical(0),
			Process Capability(Use Column Property Specs)
		)
	);

	lb = Report(dist)[OutlineBox(col_name || " Capability"), OutlineBox("Histogram"), ListBox(1)];

	vlb << Append( // use outlinebox to add title
		OutlineBox("Process Capability for " || col_name, lb);
	);
	dist << Close Window;	
);

vlb << save msword("c:\TEMP\test.doc", native);

pmroz_0-1700067130195.png

 

jthi
Super User

Re: How to save picture by jsl

I think getting the images to excel will require powershell (or something else like python) in addition to jsl. You could execute the powershell code from JMP using Run Program()

-Jarmo