cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • See how to interactively organize and restructure data for analysis. Register for May 29 webinar, 2pm US ET.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
Stefan_Moser
Level III

Script to automatically save all data tables and reports in a JMP project to the contents

I currently have the below static script that saves specific reports and tables to the project contents by name. I'd like to generalize this to a script that will do this for any project, so names would have to be dynamically generated and passed through a save function. I've played around a bit and haven't gotten close yet - help is appreciated

This is the script that currently works on fixed table names. It is run in a workflow embedded in the same project as all the tables and reports. For reports I would always want the embed to be set to 0:

proj = Current Data Table() << Get Project();

proj << Run Script(
	
	Data Table("plate_data_long") << Save As("$PROJECT/plate_data_long.jmp");
	Data Table("plate_data_wide") << Save As("$PROJECT/plate_data_wide.jmp");
	Data Table("Summarized by PC Plate_well and Process") << Save As("$PROJECT/Summarized by PC Plate_well and Process.jmp");
	Window ("Assay Plate Value Heatmap") << Save Window Report( "$PROJECT/Assay Plate Value Heatmap.jrp", embed data( 0 ) );
	Window ("Controls and Parent QC") << Save Window Report( "$PROJECT/Controls and Parent QC.jrp", embed data( 0 ) );
	Window ("Assay Plate Value Heatmap") << Save Window Report( "$PROJECT/Assay Plate Value Heatmap.jrp", embed data( 0 ) )
	;
);
1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Script to automatically save all data tables and reports in a JMP project to the contents

You can get list of data table names by using Get Data Table List

tablenames = Get Data Table List() << get name;

Report windows with Get Window List

reportwindows = Get Window List(Type("Reports"));

You can then loop over them using For Each.

Check both of those from Scripting Index as they support Project argument which you might have to use.

 

Edit: fixed command or report windows

-Jarmo

View solution in original post

4 REPLIES 4
jthi
Super User

Re: Script to automatically save all data tables and reports in a JMP project to the contents

You can get list of data table names by using Get Data Table List

tablenames = Get Data Table List() << get name;

Report windows with Get Window List

reportwindows = Get Window List(Type("Reports"));

You can then loop over them using For Each.

Check both of those from Scripting Index as they support Project argument which you might have to use.

 

Edit: fixed command or report windows

-Jarmo
Stefan_Moser
Level III

Re: Script to automatically save all data tables and reports in a JMP project to the contents

Thanks Jarmo - any clue why the second function isn't actually returning the report I have in the project? The first function works as expected for the data tables.

Snapshot of project windows: 

Stefan_Moser_1-1770919506613.png

Log showing that the below doesn't return the report

reportwindows = Get Window List(Type("Reports"));

Stefan_Moser_2-1770919621161.png

Adding a second report shows that the displaybox/headbox doesn't differentiate between multiple reports:

Stefan_Moser_3-1770919711375.png

 



jthi
Super User

Re: Script to automatically save all data tables and reports in a JMP project to the contents

Those are the report windows.

-Jarmo
mmarchandFSLR
Level VI

Re: Script to automatically save all data tables and reports in a JMP project to the contents

And, for clarity, it does differentiate between them.  You can send the <<Get Window Title message to verify this.

Recommended Articles