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;
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;
I think you need to modify your template to get that, style usertext I believe. Have a look at this article:
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;
Hi,
Try this:
Proc template;
Define style Style.Custom;
parent=styles.default;
style usertext from usertext /
font_size=8pt
font_weight=bold;
end;
run;
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;
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;
Thanks, it helped
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.