BookmarkSubscribeRSS Feed
JM_Poilane
SAS Employee

Hi,

In SAS 9.4 TS1M2 I try to set margins on a RTF document generated by an "ODS RTF" statement. Through the "OPTIONS" statement I can set these margins (MARGINLEFT etc...) but they apply to all pages of RTF file. What I want is to specify theses margins from page to page.

I read in this paper that you have to use STYLES :

http://www2.sas.com/proceedings/sugi29/125-29.pdf

However any method described in this document that I try (set margins with precise values or set margins to _undef_ special value) does not work. The only way I can do it is through styles but then I lose the papersize on the second page of my report.

Do I use the goog approach?

How to get wanted margins ?

Thanks and best regards.

Jean-Marie

3 REPLIES 3
Ksharp
Super User

Try this one :

option topmargin=1cm orientation=portrait;
ods rtf file='c:\temp\xxx.rtf';
proc print data=sashelp.class ;run;
option topmargin=10cm orientation=landscape;
ods rtf ;
proc print data=sashelp.class ;run;
ods rtf close;


Xia Keshan

sm4
Quartz | Level 8 sm4
Quartz | Level 8

Late but maybe helpful to others (since I am having the same issue):

 

Here it says:

 

"The first thing we will learn how to modify is the margins. For other ODS destinations, it is possible to modify the margins using the system options TOPMARGIN, BOTTOMMARGIN, LEFTMARGIN, and RIGHTMARGIN. However, for the RTF destination, the margin settings are hard-coded into the default RTF template, and cannot be modified via an OPTIONS statement."

I'm reading the rest of it and it seems they suggest setting margins to undefined in the template and setting them separately after that.

sm4
Quartz | Level 8 sm4
Quartz | Level 8

That worked, except that I had to make sure my first options orientation statement was before my ods rtf file= statement.

But it added pages in between each output page, I guess something to do with this: http://support.sas.com/kb/17/498.html

Except that when I commented out all orientation statements, the problem persists....

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 3 replies
  • 2475 views
  • 0 likes
  • 3 in conversation