Try something like this. With a little luck, and a small font, each report will stay on one page...
// 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 << Distribution( Continuous Distribution( Column( :weight ) ), Nominal Distribution( Column( :age ) ) );
report << journal;
report << closewindow;
report = Bivariate( Y( :weight ), X( :height ), Fit Line );
report << journal;
report << closewindow;
report = Oneway( Y( :height ), X( :sex ), Means( 1 ), Mean Diamonds( 1 ) );
report << journal;
report << closewindow;
Close( dt, nosave );
// add the header and page breaks 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 )
);
// 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<<savePDF("$desktop/report.pdf");
j<<closeWindow;
Opened PDF using Firefox
edit: you might want this too:
// make the PDF from the journal
j << setwindowtitle( " " ); // hide the title with a space
j << setpagesetup( {Margins( {0.75, 0.75, 0.75, 0.75} ), Scale( 1 ), Portrait( 1 ), Paper Size( "Letter" )} );
j << savePDF( "$desktop/report.pdf" );
The page setup might help, and cleaning out the window title makes it look a lot better!
@Anonymous
Craige