BookmarkSubscribeRSS Feed
xxformat_com
Barite | Level 11

Hi,

Given that frame= and rules= don't seem to be taken into account in the ods excel destination, I was wondering whether there would be a smarter ways of of adding the borders than this one:

 

border.JPG

 


data class;
   set sashelp.class end=_eof;
   eof=_eof;
run;

ods excel file="&xxtest./reporting/test.xlsx" 
          options(start_at='2,2');

proc report data=class 
           style(column header)=[borderstyle = hidden
                                 borderstyle = hidden]
           style(header)=[bordertopstyle    = solid
                          bordertopcolor    = red
                          borderbottomstyle = solid
                          borderbottomcolor = blue];
    column eof name--height;
    define eof / display noprint;
    compute eof;
        if eof=1 then call define(_row_,'style','style=[borderbottomstyle=solid 
                                                        borderbottomcolor=red]');
    endcomp;
run;

ods excel close;
1 REPLY 1
Ksharp
Super User
ods excel file="c:\temp\test.xlsx"  
          options(start_at='2,2');

proc report data=sashelp.class nowd 
style(column)={
 borderleftcolor=white borderleftwidth=2
 borderrightcolor=white borderrightwidth=2
 bordertopcolor=white bordertopwidth=2 
 borderbottomcolor=white borderbottomwidth=2 }
style(header)={
 borderleftcolor=cxEDF2F9 borderleftwidth=2
 borderrightcolor=cxEDF2F9 borderrightwidth=2
 bordertopcolor=black bordertopwidth=2 
 borderbottomcolor=black borderbottomwidth=2 }
;
compute weight;
if name='William' then call define(_row_,'style','style={
borderbottomcolor=black borderbottomwidth=2
}');
endcomp;
run;

ods excel close;

Ksharp_0-1640011329917.png

 

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

Explore Now →
How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1443 views
  • 0 likes
  • 2 in conversation