If I make a gridded layout in ODS, I have problems controlling the page breaks. I have made a simplified piece of code that illustrates my problem, see below.
The gridded layout below makes 2 rows and 1 column.
Because row 2 takes up more than a whole page, a page break comes after row 1. But I would like to suppress this page break.
Does anybody know how to do that?
ods pdf file="C:\Temp\test.pdf" startpage=never;
ods layout gridded rows=2 columns=1;
ods region style=[backgroundcolor=#BDC3C7 font_size=20];
ods pdf text="Test header";
ods region;
proc print data=sashelp.class; run;
proc print data=sashelp.class; run;
proc print data=sashelp.class; run;
proc print data=sashelp.class; run;
proc print data=sashelp.class; run;
proc print data=sashelp.class; run;
proc print data=sashelp.class; run;
ods layout end;
If you precede every proc print with a "ods region;" statement you can get that. But I couldn't explain that from the theory 😉
ods pdf file="/tmp/test.pdf" startpage=never;
ods layout gridded rows=2 columns=1;
ods region style=[backgroundcolor=#BDC3C7 font_size=20];
ods pdf text="Test header" ;
ods region ;
proc print data=sashelp.class; run;
ods region ;
proc print data=sashelp.class; run;
ods region ;
proc print data=sashelp.class; run;
ods region ;
proc print data=sashelp.class; run;
ods region ;
proc print data=sashelp.class; run;
ods region ;
proc print data=sashelp.class; run;
ods region ;
proc print data=sashelp.class; run;
ods layout end;
How would you suppress page break here?
ods pdf file="/tmp/test.pdf" startpage=never;
ods layout gridded rows=2 columns=1;
ods region style=[backgroundcolor=#BDC3C7 font_size=20];
ods pdf text="Test header" ;
ods region ;
proc print data=sashelp.BWEIGHT (obs=200); run;
ods layout end;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.