Getting the following error "ERROR: Unable to load image /sas/work/SAS_work42770188005A_wasascsprd2.nu.com/SAS_work08B50188005A_wasascsprd2.nu.com/Sldr1.png; default image will be used instead.", checked the output folder and png in the folder, code below.
/* detect proper delim for UNIX vs. Windows */ %let delim=%sysfunc(ifc(%eval(&sysscp. = WIN),\,/)); /* macro download in work library */ %let download_from = %sysfunc(getoption(work))&delim.; %put &download_from;
%let bnd1=(5 2.56 2.26 1.64 0);
DATA Kpi_dat; INPUT Topic $1-6 subject $8-21 nmbr prv actl mn trgt mx cmmnts $49-159; DATALINES; Income Revenue 1 1.20 1.05 2.10 2.88 3.40 Need to prepare a turn around plan. Expected completion by 12/1/16. ; run;
%macro slider(gname, actl, trgt,rng);
goptions reset=all noborder xpixels=80 ypixels=25 ftext='Arial';
ods graphics / reset=index; ods html path="&download_from" (url=none) file="&gname..html" style=listing; proc gkpi mode=raised; hslider actual=&actl bounds=&&bnd&rng / noavalue nobvalue target=&trgt colors=(red,yellow,green,blue) name="&gname"; run; quit; ods html close;
%mend slider;
data Kpi_rpt (keep=topic subject gname nmbr mn trgt mx actl clrFlg prv chng cmmnts); set Kpi_dat; if mx > mn then chng=actl-prv; if mx < mn then chng=prv-actl;
if mx > mn then do; if mn > actl then clrFlg=1; else if mn =< actl and actl < trgt then clrFlg=2; else if trgt =< actl and actl < mx then clrFlg=3; else if mx =< actl then clrFlg=4; trgt_=trgt+trgt*0.05; end; else do; if mn < actl then clrFlg=1; else if mn >= actl and actl > trgt then clrFlg=2; else if trgt >= actl and actl > mx then clrFlg=3; else if mx >= actl then clrFlg=4; trgt_=trgt-trgt*0.05; end;
gnm=compress("Sldr"||_N_); gname=trim("&download_from")||compress("Sldr"||_N_)||".png"; txt='%slider('||gname||','||put(nmbr,4.1)||')'; put txt; call execute('%slider('||trim(gnm)||','||put(actl,4.1)||','||put(trgt_,4.1)||','||nmbr||')'); run;
ods pdf notoc file="&download_from.Test.pdf";
proc report data=Kpi_rpt nowd wrap;
column topic subject gname gsprk mn trgt mx actl slider cmmnts;
define topic / order noprint; define subject / display 'Metric' format=$superfmt. display ; define gname / noprint; define gsprk / noprint; define mx / display 'Max' format=COMMA4.2 ; define trgt / display 'Target' format=COMMA4.2 ; define mn / display 'Min' format=COMMA4.2 ; define actl / display 'Actual' format=COMMA4.2; define slider / computed 'Current Month'; define cmmnts / display flow 'Comments';
compute slider / char length=62; slider=' '; call define ('slider','style',"style=[preimage='"||trim(gname)||"']"); endcomp;
run;
ods pdf close;
ods _all_ close;
... View more