ODS RTF How to set different margins on each page of RTF document

Reply
SAS Employee
Posts: 1

ODS RTF How to set different margins on each page of RTF document

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

Super User
Posts: 10,770

Re: ODS RTF How to set different margins on each page of RTF document

Posted in reply to Jean_MariePoilane

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

Contributor sm4
Contributor
Posts: 51

Re: ODS RTF How to set different margins on each page of RTF document

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.

Contributor sm4
Contributor
Posts: 51

Re: ODS RTF How to set different margins on each page of RTF document

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

Ask a Question
Discussion stats
  • 3 replies
  • 579 views
  • 0 likes
  • 3 in conversation