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

Hi,

 

Am trying to assign a specific color to the 2symbols per below:

 

ods escapechar='^';

...

ods text='^{unicode 2588}^{unicode 2588} is a red box';

 

I've tried adding cominbinations of inline styles every way I can and struck out.  Example:

ods text='^s={color=red}^{unicode 2588}^{unicode 2588} is a red box';

does not work.  

 

Anyone know the magic combination? 

 

Thanks!

 

--Ben

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi, I have an example of using Unicode 2588 to "fake" a bar chart and another example of using Unixcode 250A to "fake" a dynamically sized box. However, both of those were accomplished in cells in PROC REPORT. You did not specify your destination, so it's hard to predict what will work in every destination, but this worked for me in HTML and should work for RTF and PDF.
 


ods escapechar='^';
 

ods text='1 ^{style[color=red font_face="Thorndale AMT" fontsize=16pt] ^{unicode 2588} ^{style[font_size=12pt font_weight=bold] is a red box}}';
ods text= ' ';
ods text='2 ^{style[color=red font_face="Thorndale AMT" fontsize=16pt] ^{unicode 2588}} ^{style[font_size=12pt font_weight=bold] is a} ^{style[color=red]red} box ';

 Think of your UNICODE function as being the text string you want to have treated differently (appear in red). So that string, which happens to be a UNICODE function needs to be surrounded by a STYLE function (also invoked with ESCAPECHAR).

 

  The way the style function works is this -- assuming ESCAPECHAR is ^:

'^{style[attr=val attr1=val1]text string}'

  I know, the color coding is garish, but, I hope, makes the point that the STYLE function starts and stops with curly braces and the attribute/value pairs are enclosed in square brackets. After the ending square bracket, you have the text string (whatever it is) and then you have the closng curly brace to end the beginning curly brace (what is shown in red. Where I have text string in the example above, is where you put your ^{UNICODE 2588}, as shown in my code.

 

  Here's what it looks like in HTML output:

ods_escapechar_text_box.png
cynthia

View solution in original post

2 REPLIES 2
Cynthia_sas
SAS Super FREQ

Hi, I have an example of using Unicode 2588 to "fake" a bar chart and another example of using Unixcode 250A to "fake" a dynamically sized box. However, both of those were accomplished in cells in PROC REPORT. You did not specify your destination, so it's hard to predict what will work in every destination, but this worked for me in HTML and should work for RTF and PDF.
 


ods escapechar='^';
 

ods text='1 ^{style[color=red font_face="Thorndale AMT" fontsize=16pt] ^{unicode 2588} ^{style[font_size=12pt font_weight=bold] is a red box}}';
ods text= ' ';
ods text='2 ^{style[color=red font_face="Thorndale AMT" fontsize=16pt] ^{unicode 2588}} ^{style[font_size=12pt font_weight=bold] is a} ^{style[color=red]red} box ';

 Think of your UNICODE function as being the text string you want to have treated differently (appear in red). So that string, which happens to be a UNICODE function needs to be surrounded by a STYLE function (also invoked with ESCAPECHAR).

 

  The way the style function works is this -- assuming ESCAPECHAR is ^:

'^{style[attr=val attr1=val1]text string}'

  I know, the color coding is garish, but, I hope, makes the point that the STYLE function starts and stops with curly braces and the attribute/value pairs are enclosed in square brackets. After the ending square bracket, you have the text string (whatever it is) and then you have the closng curly brace to end the beginning curly brace (what is shown in red. Where I have text string in the example above, is where you put your ^{UNICODE 2588}, as shown in my code.

 

  Here's what it looks like in HTML output:

ods_escapechar_text_box.png
cynthia

BenConner
Pyrite | Level 9

Hi Cynthia,

 

LOL...  that was the one combination I hadn't tried.  Just wasn't creative enough.  Thank you so much!

 

The target in this case is about 5000 pdf files.

 

 

 

--Ben

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