キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Discussions

Solve problems, and share tips and tricks with other JMP users.
言語を選択 翻訳バーを非表示
WebDesignesCrow
Super User

How to convert Page Setup Setting (PDF) to JSL Script?

Hi Expert,

I'm trying to save my journal report in .pdf through JSL scripting.

My issue now is, I can save the report to fit nicely the landscape page manually using below settings;

WebDesignesCrow_0-1700103417164.png

But, when I converted the setting to JSL script, it stays in portrait.

Why my script not working? I've set the preferences to landscape as default but still not working

// add the header to the journal
j = Current Journal();
listOfReports = j << child;
nReports = N Items( listOfReports );
// add page breaks
For( i = N Items( listOfReports ), i >= 1, i--,
	Insert Into( listOfReports, Page Break Box(), i ));
// make the PDF from the journal
j << set window title ("Daily Analysis Report "||format(today(), "d/m/y",10); );
j << set page setup( {margins( {0.75, 0.75, 0.75, 0.75} ), scale( 0.94 ), portrait(0), paper size( "Letter" )} );
// make the PDF from the journal
j << save PDF("$desktop/reportJSL.pdf");uus

using JMP17.0

1 件の受理された解決策

受理された解決策
WebDesignesCrow
Super User

Re: How to convert Page Setup Setting (PDF) to JSL Script?

Got it.

Somehow, I need to add Wait (0) after set page setup & before save .pdf to make it works.

// add the header to the journal
j = Current Journal();
listOfReports = j << child;
nReports = N Items( listOfReports );
// add page breaks
For( i = N Items( listOfReports ), i >= 1, i--,
	Insert Into( listOfReports, Page Break Box(), i ));
// make the PDF from the journal
j << set window title ("Daily Analysis Report "||format(today(), "d/m/y",10); );
j << set page setup( {margins( {0.75, 0.75, 0.75, 0.75} ), scale( 0.94 ), portrait(0), paper size( "Letter" )} );
Wait(0);
// make the PDF from the journal
j << save PDF("$desktop/reportJSL.pdf");

 

元の投稿で解決策を見る

2件の返信2
WebDesignesCrow
Super User

Re: How to convert Page Setup Setting (PDF) to JSL Script?

Got it.

Somehow, I need to add Wait (0) after set page setup & before save .pdf to make it works.

// add the header to the journal
j = Current Journal();
listOfReports = j << child;
nReports = N Items( listOfReports );
// add page breaks
For( i = N Items( listOfReports ), i >= 1, i--,
	Insert Into( listOfReports, Page Break Box(), i ));
// make the PDF from the journal
j << set window title ("Daily Analysis Report "||format(today(), "d/m/y",10); );
j << set page setup( {margins( {0.75, 0.75, 0.75, 0.75} ), scale( 0.94 ), portrait(0), paper size( "Letter" )} );
Wait(0);
// make the PDF from the journal
j << save PDF("$desktop/reportJSL.pdf");

 

Mauro_Gerber
Level IV

Re: How to convert Page Setup Setting (PDF) to JSL Script?

In JMP 18 this didn't work. I had to get rid of the curly braces to make it work:

j << set page setup(Margins( {0.7, 0.2, 0.2, 0.2} ), Scale( 1 ), Portrait( 1 ),Paper Size( "A4" ));

 

"I thought about our dilemma, and I came up with a solution that I honestly think works out best for one of both of us"
- GLaDOS

おすすめの記事