Help using Base SAS procedures

Proc report

Reply
Contributor
Posts: 37

Proc report

Can you underline one word in an ods text =  statement?

 

For example:

 

ods text= "^S={ font_face = 'Times New Roman' just=j fontweight=light fontsize=12pt color=black}Background:For this project, we are looking for..."

 

I would like to ONLY underline the word "Background" above.

 

Thanks!

Occasional Contributor
Posts: 10

Re: Proc report

[ Edited ]
Posted in reply to nirali514

Here are 2 options:

 

Option 1 using inline formatting:

ods text= "^S={ font_face = 'Times New Roman' just=j fontweight=light 
fontsize=12pt color=black textdecoration=underline}Background 
^S={font_face = 'Times New Roman' just=j fontweight=light 
fontsize=12pt color=black}: For this project, we are looking for...";

Option 2 if you are using RTF then you can use RTF control words to control style:

ods rtf file="UnderlineOneWord.rtf";
ods text= "^S={ font_face = 'Times New Roman' just=j fontweight=light fontsize=12pt color=black protectspecialchars=off}
\ul{Background}\ul0 : For this project, we are looking for...";
ods rtf close;
Super Contributor
Super Contributor
Posts: 266

Re: Proc report

Posted in reply to nirali514

Theoretically, you could use CSS styles and use a pseudo class:

 

p:first-word{text-decoration:underline;}

but I don't think that is supported. 

 

 

I can do this:

ods listing;
ods html file="text.html" style=mystyle;
ods pdf file="text.pdf" startpage=never notoc style=mystyle;
ods rtf file="text_trad.rtf" style=mystyle;
ods escapechar='^';

title "January Orders ";
footnote " For All Employees";

ods text="My text 1";

ods text="^S={textdecoration=underline}My^S={} Text 2"; 

data grades;
   input id grade1 grade2 grade3 grade4;
datalines;
1105 1 2 3 4
1106 2 2 2 2
1107 3 3 4 6
;
run;

proc print data=grades;
run;

ods text="My Text 3"; 

ods pdf close;

ods rtf close;

title;
footnote;

proc template;
   delete mystyle;
   run;

The key statement there is 

 

ods escapechar='^';

 

and then its use with

^S={textdecoration=underline}My^S={}

 

See if that gets you anywhere.

Contributor
Posts: 37

Re: Proc report

Thank you, this helps!

Ask a Question
Discussion stats
  • 3 replies
  • 180 views
  • 0 likes
  • 3 in conversation