ODS and Base Reporting

Build reports by using ODS to create HTML, PDF, RTF, Excel, text reports and more!
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-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 3420 views
  • 0 likes
  • 2 in conversation