The SAS Output Delivery System and reporting techniques

How to add RTF control words with TAGSETS.RTF - issue with backslash

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 6
Accepted Solution

How to add RTF control words with TAGSETS.RTF - issue with backslash

Dear all,

 

I am trying to add RTF control words to an RTF file created with TAGSETS.RTF. I am trying both through the titles and with the text command in the ODS statement, but in both cases the backslashes are escaped inside the RTF file.

 

ods tagsets.rtf file='test.rtf' ;
ods tagsets.rtf text='{\plain\f1\b0\i0\tc\v Invisible text, in TOC   \tcf67 \tcl1 }';
title1 '\ulth this should be a double underlined title'; 
proc contents data=sashelp.class short;
run; 
ods tagsets.rtf close;

 For example the RTF file will show \\ulth and the title will not be underlined.

 

The code works fine with ODS RTF, but I need the extra features of ODS TAGSETS.RTF. According to http://www.mwsug.org/proceedings/2010/dataviz/MWSUG-2010-67.pdf, this should just work. If I replace all double backslashes by single ones inside the RTF file, the RTF file works as expected.

 

Any help welcome! Thanks in advance


Accepted Solutions
Solution
‎02-17-2016 06:12 AM
Super User
Posts: 11,121

Re: How to add RTF control words with TAGSETS.RTF - issue with backslash

You may need to investigate use of ODS ESCAPECHAR and the DEST and RAW functions.

 

Maybe

ODS ESCAPECHAR='^';

ods tagsets.rtf text= ^{dest [rtf] ^{raw \plain\f1\b0\i0\tc\v Invisible text, in TOC   \tcf67 \tcl1}};

 

View solution in original post


All Replies
Solution
‎02-17-2016 06:12 AM
Super User
Posts: 11,121

Re: How to add RTF control words with TAGSETS.RTF - issue with backslash

You may need to investigate use of ODS ESCAPECHAR and the DEST and RAW functions.

 

Maybe

ODS ESCAPECHAR='^';

ods tagsets.rtf text= ^{dest [rtf] ^{raw \plain\f1\b0\i0\tc\v Invisible text, in TOC   \tcf67 \tcl1}};

 

Occasional Contributor
Posts: 6

Re: How to add RTF control words with TAGSETS.RTF - issue with backslash

Thanks a lot, this indeed is the trick. I found that there is no need for the ^{dest [rtf] ... } if one only wants the RTF output.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

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