Hello:
I'm looking for a way to control the borders in an RTF output. Currently the spanned columns underline extends the width of the table. I'd like that to only cross the data columns (see attached).
Code below:
/** RTF **/
ods listing close;
ods rtf file="test1.rtf" style=basic;
%macro prpt;
proc report data=final split="~" nowindows missing
style(report)={outputwidth=100% just=left}
style(header)={asis=on bordertopwidth=0.24pt bordertopcolor=black font_weight=bold}
;
columns pageno paramn_new trt01an linlabel
("Worst Postbaseline Toxicity Grade^{super a}" value0 value1 value2 value3 value4 value5);
define pageno / order order=internal noprint;
define paramn_new / order order=internal noprint;
define trt01an / order order=internal noprint;
define linlabel / " " style(column)={cellwidth=2.6in just=l};
define value0 / "Grade 0" style(column)={cellwidth=1.0in just=c} style(header)={just=c font_weight=bold};
define value1 / "Grade 1" style(column)={cellwidth=1.0in just=c} style(header)={just=c font_weight=bold};
define value2 / "Grade 2" style(column)={cellwidth=1.0in just=c} style(header)={just=c font_weight=bold};
define value3 / "Grade 3" style(column)={cellwidth=1.0in just=c} style(header)={just=c font_weight=bold};
define value4 / "Grade 4" style(column)={cellwidth=1.0in just=c} style(header)={just=c font_weight=bold};
define value5 / "Missing" style(column)={cellwidth=1.0in just=c} style(header)={just=c font_weight=bold};
break after pageno / page ;
%if (&nobs eq 0) %then %do;
compute after paramn_new;
line @2 'No Lab data. ';
endcomp;
%end;
%else %do;
compute after paramn_new;
line @2 ' ';
endcomp;
compute linlabel;
if (indexw(linlabel,'m')=1) then do;
linlabel=substr(linlabel,3,length(linlabel));
call define(_col_, "style", "style=[leftmargin=25]");
call define('_c1_',"style","style=[background=red]");
end;
endcomp;
%end;
run;
%mend prpt;
%prpt;
ods rtf close;
ods listing;
Indeed. Fortunately I figured out a solution. Force a blank header for column 1 and set the bottom border to white, which effectively hides it.
columns pageno paramn_new trt01an
('^S={borderbottomcolor=white}' linlabel)
("Worst Postbaseline Toxicity Grade^{super a}" value0 value1 value2 value3 value4 value5);
Indeed. Fortunately I figured out a solution. Force a blank header for column 1 and set the bottom border to white, which effectively hides it.
columns pageno paramn_new trt01an
('^S={borderbottomcolor=white}' linlabel)
("Worst Postbaseline Toxicity Grade^{super a}" value0 value1 value2 value3 value4 value5);
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.