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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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
  • 4 replies
  • 2402 views
  • 0 likes
  • 2 in conversation