Hi @Cynthia_sas , you've been helping me out a few minutes ago.
I'm happy with the ods graphics output but when I choose ods pdf the preimages are shown completely dis-configured.
Furthrmore I'd like to add a grand total but by "producto" in my case. If I use the "rbreak after / summarize ;" statement I get an grand total but not separated by group.
ods pdf file='/caslibs/marketing/useimg.pdf' ;
options missing=' ';
proc report data=dna.all spanrows nowd style(report)=[rules=none frame=void linethickness=4 ];
where lowcase(brand) ne "other";
title 'KPI overview';
column logo brand producto ren fin kpi ;
define brand / group noprint;
define producto / group ;
define ren / sum;
define fin / sum;
define logo / computed ;
define kpi / computed f=percent9.1;
break before brand / summarize;
/* rbreak after / summarize; */
compute kpi;
kpi = ren.sum / fin.sum;
if strip(_break_) not in ("_RBREAK_" "" ) then CALL DEFINE('LOGO','STYLE',"STYLE=
{PREIMAGE='/caslibs/marketing/" ||TRIM(lowcase(brand))|| ".png?height=3cm'}");
endcomp;
run;
ods pdf close;
For sizing the graph, have you tried goptions? For example:
/* Size each graph 4in x 4in */
goptions hsize=4in vsize=4in;
Unfortunately this doesn't fix the problem.
the best result is when I use ods htm.
but it's not as automatic as I hoped.
After executing the code I download the htm to my windows environment's folder where I dropped as well the png the code dynamically assigns to "logo".
In order to achieve the right sizing of the images I open the htm with a text editor and add a height statement to the htm img line.
<img alt="" src="C:\Users\DKXENLO\Pictures\audi.png" style="width=5cm"
ods escapechar='^';
ods html file='/caslibs/danalytics/kapi.htm' ;
options missing=' ';
proc report data=dna.all spanrows nowd style(report)=[rules=none frame=void linethickness=4 ];
where lowcase(brand) ne "other";
title 'KPI overview';
column logo brand producto ren fin kpi ;
define brand / group noprint;
define producto / group ;
define ren / sum;
define fin / sum;
define logo / computed ;
define kpi / computed f=percent9.1;
break before brand / summarize;
rbreak after / summarize ;
compute kpi;
kpi = ren.sum / fin.sum;
if strip(_break_) not in ("_RBREAK_" "") then CALL DEFINE('LOGO','STYLE',"STYLE=
{PREIMAGE="" " ||TRIM(lowcase(brand))|| ".png?height=3cm"" }");
endcomp;
run;
ods html close;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.
Ready to level-up your skills? Choose your own adventure.