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

Hello

I am making a report, where it is necessary for the document to be both in landscape and portrait.

Is it possible in the document to do something like say: Page 1-5 should be portrait and the rest should be landscape? If yes, then how would it be done?

When making the tables in proc report I fliter the work.file with the "where" function, so, as far as I am aware, I cannot just use the proc print function.

The destination is rtf.

All help will be greatly appreciated.

Best Regards

Bruce

1 ACCEPTED SOLUTION

Accepted Solutions
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Ah yes, you need to add in ods rtf; after the orientation change.  Also make sure to specify a style= in your procs e.g:

ODS rtf File = "s:\temp\rob\Name.rtf";

ods listing close;

ods noresults;

ods output close;

options orientation=portrait;

ods rtf;

proc report data=sashelp.class nowd style=your_style_here;

run;

options orientation=landscape;

ods rtf;

proc report data=sashelp.class nowd style=your_style_here;

run;

ods rtf close;

View solution in original post

4 REPLIES 4
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Should just be a matter of putting the ods orientation= statement between your procs.

ods rtf file="...";

ods orientation=landscape;

proc print...

ods orientation=portrait;

proc..

...

Bruce123
Calcite | Level 5

Hello

I tried the "ods orientation" but for some reason it does not work. In the log it says that the statement is used out of order.

Currently I have the following code for the orientation and file:

OPTIONS ORIENTATION=PORTRAIT NODATE ;

ODS OUTPUT CLOSE;         

ODS LISTING CLOSE;

ODS RTF File = "Name.rtf "

I tried copying the above between the proc reports statements, but it doesn't work, even though Sas does not state an error i the log.

Do you have any suggestions to my problem?

Best Regards

Bruce

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Ah yes, you need to add in ods rtf; after the orientation change.  Also make sure to specify a style= in your procs e.g:

ODS rtf File = "s:\temp\rob\Name.rtf";

ods listing close;

ods noresults;

ods output close;

options orientation=portrait;

ods rtf;

proc report data=sashelp.class nowd style=your_style_here;

run;

options orientation=landscape;

ods rtf;

proc report data=sashelp.class nowd style=your_style_here;

run;

ods rtf close;

Bruce123
Calcite | Level 5

Hey

Thanks for your help. That solved it Smiley Happy

Have a nice day

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 2779 views
  • 0 likes
  • 2 in conversation