Hi everyone,
Whenever I had a reference to ^{lastpage} , my image added using ^preimage disappears, like in the minimal working example (MWE) below. Any idea how I could go to get both in the same report?
thanks
ods pdf file="c:\temp\report1.pdf" dpi=150 style=minimal ;
OPTIONS NODATE NONUMBER;
ods escapechar = '^';
Title1 j = l '^S={preimage="https://upload.wikimedia.org/wikipedia/en/thumb/9/96/Quebec_Nordiques_Logo.svg/200px-Quebec_Nordiques_Logo.svg.png" '
j=r "Report";
footnote1 j=l "Generated today"
j=r "total number of pages: ^{lastpage} - graph is not shown";
*footnote1 j=l "Generated today"
j=r "current page number ^{thispage} -graph is shown ";
proc sort data= sashelp.class out=temp;; by sex height weight;
run;
data temp;
set temp;
by sex;
if first.sex then sex2= sex;
else sex2="";
obs=_n_;
weight_cat= floor(weight/10)*10;
_empty=' ';
run;
proc report data=temp ls=120 ps=40 nowd
split="*"
style(report)=
[ frame = void /* outside borders: void, box, above/below, vsides/hsides, lhs/rhs */
rules = groups /* internal borders: none, all, cols, rows, groups */]
style(header)=
[just=r]
style(column)=
[just=r];
column
obs
sex2
name
_empty
("^S={just=c borderbottomwidth=2 borderbottomcolor=&lightgrey.} Metrics^{super 1}" height weight )
row_color
;
define obs /display noprint;
define sex2/display "Sex" style(header)=[just=l borderbottomwidth=2 borderbottomcolor=&lightgrey.] style(column)=[just=l];
define name /display "Name" style(header)=[just=l borderbottomwidth=2 borderbottomcolor=&lightgrey.] style(column)=[just=l];
define _empty/' ' style(column)={cellwidth=1%} style(header)=[just=c vjust=top borderbottomcolor=lightgrey];
define height/display "Height" format =5.1 style(header)=[just=r borderbottomwidth=2 borderbottomcolor=&lightgrey.] style(column)=[just=r];
define weight /display "Weight^{super 2}" format =5.0 style(header)=[just=r borderbottomwidth=2 borderbottomcolor=&lightgrey.] style(column)=[just=r ] format=16.;
define row_color /computed noprint;
compute row_color;
if mod(obs,2)=1 then call define (_row_,"style","style=[background=&verylightgrey.]");
if weight<=100 then call define ("weight","style","style=[font_weight=bold background=GREEN ");
if weight>=100 then call define ("weight","style","style=[font_weight=bold background=red ");
endcomp;
run;
quit;
ods pdf close;
So there is a work around, thanks!
that being said, it would be nice if SAS could at least pop a warning...
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.