BookmarkSubscribeRSS Feed
ballardw
Super User

Has anyone discovered a way to place text in an RTF document using ODS RTF TEXT="Any text" that doesn't result in the text appearing in a cell/table when opened in Word?

My users complain about copying blocks of text out of reports formated as tables.

3 REPLIES 3
Cynthia_sas
SAS Super FREQ

Hi:

  I believe you can't change the original ODS RTF destination output. However, in the documentation for the new TAGSETS.RTF destination (SAS 9.2),

http://support.sas.com/documentation/cdl/en/odsug/62755/HTML/default/viewer.htm#p19rpsb989jyadn1kgun...

The TABLES_OFF suboption is illustrated, which does exactly what you want. If you have SAS 9.2, you should find that using this suboption just put your TEXT= string into a regular paragraph, not in a table.

   

cynthia

ods tagsets.rtf file='c:\temp\text_notab.rtf' startpage=no

                options (TABLES_OFF='usertext');

     

proc print data=sashelp.class(obs=3);

run;

   

ods tagsets.rtf text= 'This is a line of text';

   

proc print data=sashelp.shoes(obs=3);

run;

  

ods _all_ close;

ballardw
Super User

I had experimented with TAGSETS.RTF and the TABLES_OFF='usertext' option in 9.2.0 and wasn't happy with the results. I now have 9.2.3 and I don't see any different behavior.

Here is one example of a line of the text we are currently using:

ods rtf text="^S={fontsize=26PT just=C fontweight=Bold leftmargin=1.0in rightmargin=1.0in topmargin=2in}{Nutrition Surveillance Trend Report}^{newline 5}{&yearstring}^{newline 2}{Idaho WIC Program}^{nbspace}";

When trying to use this with ODS TAGSETS.RTF TEXT= the justification and margin information is completely ignored. If instead I try ODS TEXT= then elements such as the "{" and "}" as well as some of the RTF tags such as "\b" become visible in the document.

I have done a moderate amount of searching on the SAS tech support site for TAGSETS.RTF and uses of ESCAPECHAR and while ODS RTF and ODS PDF have many examples of inline formatting I haven't found any except font size or weight that are similar to my example for ODS TAGSETS.RTF.

So at this time I'm saying this is only partially answered.

Cynthia_sas
SAS Super FREQ

Hi:

  I would really recommend working with Tech Support on this issue. They can try to figure out what's going on by looking at all your code and your output, take your version of SAS into consideration and then, if they need to escalate the question to the developers, they can do that too.

  cynthia

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
  • 3 replies
  • 1565 views
  • 1 like
  • 2 in conversation