BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Bruce123
Calcite | Level 5

Hello

I am having trouble using the ods text function.

I wish to write some text, which is no problem, but I have some trouble when I try to choose a specific text size. I can't seem to get it to work and was hoping that someone could help or explain what is wrong.

Here is my code:

OPTIONS ORIENTATION=LANDSCAPE NODATE ;

ODS OUTPUT CLOSE;         

ODS LISTING CLOSE;

ODS RTF File = "C:AAA " /*STYLE=fancyPrinter*/;

PROC REPORT DATA = Have HEADLINE NOWINDOWS SPLIT='*'

%ReportStyles_2;

WHERE mv > 0.5  AND Performance_AATD NE 0 AND ParentNodeName ='B';

COLUMNS ParentNodeName ;

DEFINE ParentNodeName / 'Type' GROUP STYLE(column) = [cellwidth=40pt font_face=Verdana font_size=1.75] ORDER=DATA;

ods pdf text = "^S=[font_weight=bold font_size=14pt]A. ^mOperatoin Definition: ^S=[font_size=14pt] Hello";

RUN;

TITLE;

ODS RTF CLOSE;

1 ACCEPTED SOLUTION

Accepted Solutions
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Yes, it should apply to the file as opened.  Hang on, just noticed something in your code.  You are opening an rtf with your ods statement and then using ods pdf text.  As far as I am aware you can't mix it like that.  Maybe try:

ods rtf file="MyFile.rtf" style=custom;

ods text="Some text to output";

print something.

ods rtf close;

View solution in original post

6 REPLIES 6
RW9
Diamond | Level 26 RW9
Diamond | Level 26

I think you need to modify your template to get that, style usertext I believe.  Have a look at this article:

SAS(R) 9.2 Output Delivery System: User's Guide

Bruce123
Calcite | Level 5

Hello

Thanks for the link.

But I am quite new to sas, so I am still having some trouble.

I've made the following template but when using the proc report, I do still not get the wished size. Could you help me?

Proc template;

Define style Style.Custom;

parent=styles.default;

Style fonts /

Font_Face = "Times, Helvtica, sans-serif"

Font_size = 8pt

FONT_WEIGHT = bold

FONT_STYLE = italic

FOREGROUND = cx002288

BACKGROUND = cxe0e0e0;

end;

run;

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Hi,

Try this:

Proc template;

Define style Style.Custom;

parent=styles.default;

style usertext from usertext /

      font_size=8pt

      font_weight=bold;

end;

run;

Bruce123
Calcite | Level 5

hmm doesn't seems to work.

Correct me if I am wrong, but after I run the template, I am onlu supposed to in the ods statement supposed to write style=Custom, right?

e.g. rtf file ="AA.rtf" style=Custom;

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Yes, it should apply to the file as opened.  Hang on, just noticed something in your code.  You are opening an rtf with your ods statement and then using ods pdf text.  As far as I am aware you can't mix it like that.  Maybe try:

ods rtf file="MyFile.rtf" style=custom;

ods text="Some text to output";

print something.

ods rtf close;

Bruce123
Calcite | Level 5

Thanks, it helped Smiley Happy

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