BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
megsredl
Obsidian | Level 7

I'm trying to create a PDF report containing a lot of small tables and accompanying text. I can fit more than one table per page, so I am using "startpage=no" so multiple tables appear on a page, otherwise the report would be really long. However, tables are being split across two pages when they can't fit on the current page. I would like to start a new page if the table cannot fit on the current page, and ideally start a new page for different sections of the report. How do you add page breaks when using startpage=no?

 

Not sure if my code is necessary here, but here is my code to open the file:

ods escapechar="^";
ods pdf file="title.pdf" startpage=no;
	options nodate;

Thank you for the help!

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

Use the NOW value for the option. 

 

See the 7th example in the documentation.

 

ods html close;   /* Not needed if using SAS Studio */

options nodate;

ods pdf file="file.pdf" notoc startpage=no ;


title "Top of the First Page Title";
footnote "Bottom of the first page footnote";


proc report data=sashelp.cars ;
   col origin enginesize mpg_city;
   where mpg_highway gt 45;
run;


title;
footnote;

ods graphics on / reset noborder;
   proc sgplot data=sashelp.cars;
    where mpg_highway gt 45;
    scatter x=enginesize y=mpg_city;
  run;

ods pdf startpage=now;

title "Top of the Second Page Title";
footnote "Bottom of the second page footnote";


proc report data=sashelp.cars ;
   col make model type;
   where mpg_highway gt 45;
run;



title;
footnote;

proc sgplot data=sashelp.cars;
   where mpg_highway gt 45;
   scatter x=enginesize y=mpg_highway;
run;



ods pdf close;   /* Not needed if using SAS Studio */
ods html;

@megsredl wrote:

I'm trying to create a PDF report containing a lot of small tables and accompanying text. I can fit more than one table per page, so I am using "startpage=no" so multiple tables appear on a page, otherwise the report would be really long. However, tables are being split across two pages when they can't fit on the current page. I would like to start a new page if the table cannot fit on the current page, and ideally start a new page for different sections of the report. How do you add page breaks when using startpage=no?

 

Not sure if my code is necessary here, but here is my code to open the file:

ods escapechar="^";
ods pdf file="title.pdf" startpage=no;
	options nodate;

Thank you for the help!


 

View solution in original post

2 REPLIES 2
Reeza
Super User

Use the NOW value for the option. 

 

See the 7th example in the documentation.

 

ods html close;   /* Not needed if using SAS Studio */

options nodate;

ods pdf file="file.pdf" notoc startpage=no ;


title "Top of the First Page Title";
footnote "Bottom of the first page footnote";


proc report data=sashelp.cars ;
   col origin enginesize mpg_city;
   where mpg_highway gt 45;
run;


title;
footnote;

ods graphics on / reset noborder;
   proc sgplot data=sashelp.cars;
    where mpg_highway gt 45;
    scatter x=enginesize y=mpg_city;
  run;

ods pdf startpage=now;

title "Top of the Second Page Title";
footnote "Bottom of the second page footnote";


proc report data=sashelp.cars ;
   col make model type;
   where mpg_highway gt 45;
run;



title;
footnote;

proc sgplot data=sashelp.cars;
   where mpg_highway gt 45;
   scatter x=enginesize y=mpg_highway;
run;



ods pdf close;   /* Not needed if using SAS Studio */
ods html;

@megsredl wrote:

I'm trying to create a PDF report containing a lot of small tables and accompanying text. I can fit more than one table per page, so I am using "startpage=no" so multiple tables appear on a page, otherwise the report would be really long. However, tables are being split across two pages when they can't fit on the current page. I would like to start a new page if the table cannot fit on the current page, and ideally start a new page for different sections of the report. How do you add page breaks when using startpage=no?

 

Not sure if my code is necessary here, but here is my code to open the file:

ods escapechar="^";
ods pdf file="title.pdf" startpage=no;
	options nodate;

Thank you for the help!


 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 5084 views
  • 2 likes
  • 2 in conversation