The SAS Output Delivery System and reporting techniques

ODS RTF WORDSTYLE option

Reply
Not applicable
Posts: 0

ODS RTF WORDSTYLE option

Hi
from http://support.sas.com/rnd/base/ods/odsrtf/rtf901.html
I have learned that the following statements

ods rtf file='test.rtf' wordstyle="{\s1 Heading 1;}" ;

ods escapechar='\';

ods rtf prepage = '\R/RTF"\s1 " TESTING 123';
proc print data=sashelp.class;
run;

can be used to format the title with Header style and after post-processing to create a custom TOC in my RTF output.

The wordstyle option defines "Heading 1".
Does anybody know how the option should read if I want to include another Header style, e.g. "Header 2" and use both e.g.

for the first part of the output (style header 1)
ods rtf prepage = '\R/RTF"\s1 " TESTING 123';
proc print data=sashelp.class;
run;

and for the second part of the output (style header 2)

ods rtf prepage = '\R/RTF"\?? " TESTING 456';
proc print data=sashelp.class;
run;

Thanks
UStat
SAS Super FREQ
Posts: 9,365

Re: ODS RTF WORDSTYLE option

Posted in reply to deleted_user
Hi:
It was my understanding that s1/Heading 1 and s2/Heading 2 were ways for you to link a "nickname" s1 to an already defined Microsoft Word style Heading 1 (like in normal.dot styles). So you'd have to know what other "names" were available on the Word side to use.

I remember playing around with it a bit and it seemed a lot of work. I can't find my program. Perhaps some variant of this syntax will work:
[pre]
ods rtf file='test.rtf' wordstyle="{\s1 Heading 1; \s2 Heading 2;}" ;
[/pre]

where s1 and s2 are your nicknames and Heading 1 and Heading 2 are the Word styles you want. This SUGI paper talks about building TOC in RTF files, but doesn't go beyond the s1 method:
http://www2.sas.com/proceedings/forum2007/097-2007.pdf

But, the author does show the use of a \tc rtf control string and has an extensive set of references at the end of the paper.

For more help using WORDSTYLE, you might consider contacting Tech Support.

cynthia
Not applicable
Posts: 0

Re: ODS RTF WORDSTYLE option

Posted in reply to Cynthia_sas
Hi Cynthia
yes I know about the names to be used for the MS WORD styles.
I only did not know how to incorporate this in the wordstlye option, but the example you have given worked fine.

Thank you
UStat
Ask a Question
Discussion stats
  • 2 replies
  • 875 views
  • 0 likes
  • 2 in conversation