Hi: for the Thorndale AMT example to work, you need to be sure you have an ODS ESCAPECHAR statement before you use the data: ods escapechar='^'; My approach to the second alternative was similar to Ksharp's method, I just did not macro-ize the code. I will dig it up and post it. cynthia
Here's all the code I used:
** Make Test Data;
data testdata;
length pchar $4000 unibar $15 plabl $9;
retain unibar '^{unicode 2588}';
set sashelp.class;
where age in (12,13);
percent=height/weight;
plabl = put(percent,percent9.2);
pround = round((percent*25),1);
pchar = catt(repeat(unibar,pround),put(percent,percent9.2));
put _all_;
run;
**1) Thorndale AMT approach works for me in ODS PDF and ODS HTML;
ods escapechar='^';
ods html file='c:\temp\bar_with_font.html' style=htmlblue;
ods pdf file='c:\temp\bar_with_font.pdf';
proc report data=testdata;
column name age sex height weight percent pchar;
define pchar / style(column)={color=red font_face='Thorndale AMT'};
format percent percent9.2;
run;
ods pdf close;
ods html close;
** 2) make an image using SGPLOT approach;
** be sure to create images are in c:\temp using GPATH=;
ods html path='c:\temp' (url=none)
gpath='c:\temp' (url=none)
file='checkbars.html';
** make images fairly small to fit in final table;
** run one SGPLOT for every student;
** could "macro-ize" this piece of code;
ods graphics / reset=all height=.5in width=3.5in imagename="Alice" imagefmt=png;
proc sgplot data=testdata noborder;
where name = "Alice";
hbar name / response=percent name="Alice"
dataskin=matte
datalabel=plabl
datalabelattrs=(Color=Navy Family='Courier New' Size=14 )
datalabelfitpolicy=none;
xaxis values=(0 to 1 by .1) display=none;
yaxis display=none;
run;
ods graphics / height=.5in width=3.5in imagename="John" imagefmt=png;
proc sgplot data=testdata noborder;
where name = "John";
hbar name / response=percent name="John"
dataskin=matte
datalabel=plabl
datalabelattrs=(Color=Navy Family='Courier New' Size=14 )
datalabelfitpolicy=none;
xaxis values=(0 to 1 by .1) display=none;
yaxis display=none;
run;
ods graphics / height=.5in width=3.5in imagename="Robert" imagefmt=png;
proc sgplot data=testdata noborder;
where name = "Robert";
hbar name / response=percent name="Robert"
dataskin=matte
datalabel=plabl
datalabelattrs=(Color=Navy Family='Courier New' Size=14 )
datalabelfitpolicy=none;
xaxis values=(0 to 1 by .1) display=none;
yaxis display=none;
run;
ods html close;
** not entirely happy with resolution of datalabel in PDF output;
** but I would probably work with Tech Support on how to improve that;
** or design the report so that percent was in a separate column;
ods html gpath='c:\temp' (url=none)
path='c:\temp' (url=none)
file = 'final.html';
ods pdf file='c:\temp\final.pdf';
proc report data=testdata
style(column)={vjust=m};
where name in ('Alice' 'Robert' 'John');
column name age sex height weight percent pcell;
define pcell / computed;
compute pcell;
pcell = ' ';
if name = 'Alice' then do;
call define(_col_,'style','style={preimage="c:\temp\Alice.png"}');
end;
else if name = 'John' then do;
call define(_col_,'style','style={preimage="c:\temp\John.png"}');
end;
else if name = 'Robert' then do;
call define(_col_,'style','style={preimage="c:\temp\Robert.png"}');
end;
endcomp;
format percent percent9.2;
run;
ods _all_ close;
... View more