BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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
2 REPLIES 2
Cynthia_sas
SAS Super FREQ
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
deleted_user
Not applicable
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

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