<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to get the total number of pages for JMP report in JSL? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/solved/m-p/449391#M69616</link>
    <description>&lt;P&gt;Try something like this. With a little luck, and a small font, each report will stay on one page...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// use the journal to accumulate the reports.
// if they fit on a single page, the page count will be correct.
dt = Open( "$sample_data/big class.jmp", "invisible" );
report = dt &amp;lt;&amp;lt; Distribution( Continuous Distribution( Column( :weight ) ), Nominal Distribution( Column( :age ) ) );
report &amp;lt;&amp;lt; journal;
report &amp;lt;&amp;lt; closewindow;

report = Bivariate( Y( :weight ), X( :height ), Fit Line );
report &amp;lt;&amp;lt; journal;
report &amp;lt;&amp;lt; closewindow;

report = Oneway( Y( :height ), X( :sex ), Means( 1 ), Mean Diamonds( 1 ) );
report &amp;lt;&amp;lt; journal;
report &amp;lt;&amp;lt; closewindow;

Close( dt, nosave );

// add the header and page breaks to the journal
j = Current Journal();
listOfReports = j &amp;lt;&amp;lt; child;
nReports = N Items( listOfReports );

// add page breaks
For( i = N Items( listOfReports ), i &amp;gt;= 1, i--,
	Insert Into( listOfReports, Page Break Box(), i )
);

// and the header
headerPage = V List Box( 
	Text Box( "Big Report" ), 
	Text Box( Format( Today(), "yyyy-mm-dd" ) ), 
	Text Box( Char( nReports ) || " pages (reports)" ) 
);
Insert Into( listOfReports, headerPage, 1 );

// make the PDF from the journal
j&amp;lt;&amp;lt;savePDF("$desktop/report.pdf");

j&amp;lt;&amp;lt;closeWindow;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Opened PDF using Firefox" style="width: 342px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/38758i9011C2CEB84346DA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Opened PDF using Firefox" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Opened PDF using Firefox&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;edit: you might want this too:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// make the PDF from the journal
j &amp;lt;&amp;lt; setwindowtitle( " " ); // hide the title with a space
j &amp;lt;&amp;lt; setpagesetup( {Margins( {0.75, 0.75, 0.75, 0.75} ), Scale( 1 ), Portrait( 1 ), Paper Size( "Letter" )} );
j &amp;lt;&amp;lt; savePDF( "$desktop/report.pdf" );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The page setup might help, and cleaning out the window title makes it look a lot better!&lt;/P&gt;
&lt;P&gt;@Anonymous&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 06 Jan 2022 11:21:48 GMT</pubDate>
    <dc:creator>Craige_Hales</dc:creator>
    <dc:date>2022-01-06T11:21:48Z</dc:date>
    <item>
      <title>solved</title>
      <link>https://community.jmp.com/t5/Discussions/solved/m-p/449325#M69610</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;solved&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:42:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/solved/m-p/449325#M69610</guid>
      <dc:creator>jemg</dc:creator>
      <dc:date>2023-06-10T23:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the total number of pages for JMP report in JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/solved/m-p/449391#M69616</link>
      <description>&lt;P&gt;Try something like this. With a little luck, and a small font, each report will stay on one page...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// use the journal to accumulate the reports.
// if they fit on a single page, the page count will be correct.
dt = Open( "$sample_data/big class.jmp", "invisible" );
report = dt &amp;lt;&amp;lt; Distribution( Continuous Distribution( Column( :weight ) ), Nominal Distribution( Column( :age ) ) );
report &amp;lt;&amp;lt; journal;
report &amp;lt;&amp;lt; closewindow;

report = Bivariate( Y( :weight ), X( :height ), Fit Line );
report &amp;lt;&amp;lt; journal;
report &amp;lt;&amp;lt; closewindow;

report = Oneway( Y( :height ), X( :sex ), Means( 1 ), Mean Diamonds( 1 ) );
report &amp;lt;&amp;lt; journal;
report &amp;lt;&amp;lt; closewindow;

Close( dt, nosave );

// add the header and page breaks to the journal
j = Current Journal();
listOfReports = j &amp;lt;&amp;lt; child;
nReports = N Items( listOfReports );

// add page breaks
For( i = N Items( listOfReports ), i &amp;gt;= 1, i--,
	Insert Into( listOfReports, Page Break Box(), i )
);

// and the header
headerPage = V List Box( 
	Text Box( "Big Report" ), 
	Text Box( Format( Today(), "yyyy-mm-dd" ) ), 
	Text Box( Char( nReports ) || " pages (reports)" ) 
);
Insert Into( listOfReports, headerPage, 1 );

// make the PDF from the journal
j&amp;lt;&amp;lt;savePDF("$desktop/report.pdf");

j&amp;lt;&amp;lt;closeWindow;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Opened PDF using Firefox" style="width: 342px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/38758i9011C2CEB84346DA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Opened PDF using Firefox" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Opened PDF using Firefox&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;edit: you might want this too:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// make the PDF from the journal
j &amp;lt;&amp;lt; setwindowtitle( " " ); // hide the title with a space
j &amp;lt;&amp;lt; setpagesetup( {Margins( {0.75, 0.75, 0.75, 0.75} ), Scale( 1 ), Portrait( 1 ), Paper Size( "Letter" )} );
j &amp;lt;&amp;lt; savePDF( "$desktop/report.pdf" );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The page setup might help, and cleaning out the window title makes it look a lot better!&lt;/P&gt;
&lt;P&gt;@Anonymous&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jan 2022 11:21:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/solved/m-p/449391#M69616</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2022-01-06T11:21:48Z</dc:date>
    </item>
  </channel>
</rss>

