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

Batch creation of journals based on spreadsheet entry

I have a set of working JSL scripts which take user input (part ID, test date, test limits, file format etc), loads the test data (from a database for the entered parameters), plots the graphs etc and then passes all of them to journal which is then saved as PDF (while the test data is saved in user specified file format). Currently, this works only for one given set of user input (part ID, test date, test limits, file format etc). As the partIDs change, the other user input parameters usually remain same.

In this view, I would like to change my script where the flow is 

  • A list, say an excel spreadsheet, consisting of part IDs is loaded via a dialog box (via File -->Open-->).
  • User presses a button, say an OK button and one by one the part IDs are taken from the spreadsheet and JMP does its work, saves the PDF (and data file) in user specified location and moves on to the next part ID until the end of the list.
  • A progress bar is displayed while the operations are underway.

Normally, I would do such a thing under a for loop but as I have only recently learnt JMP, I was wondering if there are functions already existing which I could use rather than writing my own?

Can I request a simple example of a JSL script for creating a dialog box for browsing an excel file, loading it and performing operation on each row (of the first column) and existing. This should get me started (status bar can come in the next iteration).

Thanks.  

When it's too good to be true, it's neither
1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Batch creation of journals based on spreadsheet entry

Below are some functions which should help you:

 

  1. Use Pick File() to get the file path to variable
  2. Use dt = Open() to open the path (might have to open first with interactive option to get proper source script if excel file is complicated) and save the reference to variable dt
  3. Get the values from first column to a variable with some of the many options JMP has. Below are couple options, with the assumption that there are no duplicate values:
    1. var_list = dt[0,1];
    2. var_list = Column(dt,1) << get values;
  4. If JMP16, use For Each() to loop over list. If version before JMP16 use For loop.
  5. Perform operations inside the loop
  6. Close datatable with Close(dt, nosave)
  7. If you want to close also JMP, you can use Quit(no save)

To get user interface with OK (and Cancel) button, take a look at New Window() with << modal

-Jarmo

View solution in original post

1 REPLY 1
jthi
Super User

Re: Batch creation of journals based on spreadsheet entry

Below are some functions which should help you:

 

  1. Use Pick File() to get the file path to variable
  2. Use dt = Open() to open the path (might have to open first with interactive option to get proper source script if excel file is complicated) and save the reference to variable dt
  3. Get the values from first column to a variable with some of the many options JMP has. Below are couple options, with the assumption that there are no duplicate values:
    1. var_list = dt[0,1];
    2. var_list = Column(dt,1) << get values;
  4. If JMP16, use For Each() to loop over list. If version before JMP16 use For loop.
  5. Perform operations inside the loop
  6. Close datatable with Close(dt, nosave)
  7. If you want to close also JMP, you can use Quit(no save)

To get user interface with OK (and Cancel) button, take a look at New Window() with << modal

-Jarmo