cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
glimond67
Level I

unwanted hidden report generated when saving journal to PDF

I have been using scripts that put many graphs to a journal then save the journal as pdf and close. The reports can get quite big, and I repeat the operation many times.

 

Below the part of script I use to save the current journal as pdf.

 

myjrn = Current Journal();
myjrn << Save PDF( "MyFile.pdf", Show Page Setup( 0 ) );

 

 

I realise recently in JMP15 that when the last line is executed a hidden report is also produced in Window List, which seems to be a copy of the journal.

 

My script then closes the journal.

 

myrn<<closewindow(1);

 

But the hidden report remains open. If I continue to run many scripts I end up running out of memory.

@martindemel :  How to close this hidden report?

 

 

2 REPLIES 2
jthi
Super User

Re: unwanted hidden report generated when saving journal to PDF

Issue could be same as here JSL: Send analysis to journal, and then save PDF . Seems like JMP won't allow you to save Journal as PDF. So it seems like when you run << Save PDF it will first convert the journal to report and this report is the hidden window.

 

Not sure if you can get reference to this Report which is generated, but you could get all open windows before running << Save PDF and then after saving run it again, and close the "extra" window.

-Jarmo

Re: unwanted hidden report generated when saving journal to PDF

Here is what you need:

 

  • The invisible report is generated invisible, but it will be the last window created
  • Using “Get Window List()” combined with “Get Window Title”
windowList = Get Window List()<< Get Window Title();

 

you will see the titles of the window and see the Report: Untitled # will be the last entry.

  • With that knowledge and assuming you do not add additional windows in-between you can close that window using
Window(windowList[N Items(windowList)]) << close window;
  • Your script should then look like this:

 

myjrn = Current Journal();
myjrn << Set page setup( margins( 0.75, 0.75, 0.75, 0.75 ), scale( 0.65 ), portrait( 1 ), paper size( "A4" ) );
myjrn << Set Print Headers( "My Header", "", "Page &pn; of &pc;" );
myjrn << Save PDF( "MyFile.pdf", Show Page Setup( 0 ) );
myjrn << close window; // in case you want the journal closed

windowList = Get Window List()<< Get Window Title();
Window(windowList[N Items(windowList)]) << close window;

 

Of course you could be even smarter and check any window title with “Report: Untitled…” in the name and close these. But that’s another story

 

Another alternative is to use "Current Report". In general I try to reference to windows explicitly (e.g. through names I grab or assigning if possible. "Current journal" a or "current report" or "current data table" always have a chance to refer to the wrong window/table/report in case there are either multiples open or the user has time to do something in-between.

 

I cannot say something about why the behaviour changed with JMP 15 but support@jmp.com may be able to answer this question.

 

All the best, Martin

/****NeverStopLearning****/