The SAS Output Delivery System and reporting techniques

ODS Excel Output

Reply
Senior User
Posts: 1

ODS Excel Output

Hi, I'm trying to add horizontal lines in my ODS excel output.

This is my sas code.

 

ods excel file='C:\Users\Administrator\Desktop\ODS\reportex.xlsx' style=SasDocPrinter
options(embedded_titles='yes' frozen_headers='yes' start_at='2,2' absolute_column_width='8' );
title1 font='Calibri' color=crimson bold h=30pt 'I Love Blue Color';
proc report data=vintexample
style(header)=[font_style=italic background=lightred fontsize=4 font_face='Calibri' foreground=white]
style(column)=[font_face='Calibri'];
define year / display group style(header)=[background=#000000];
define month / display style(header)=[background=#00096F];
define cnt / display style(header)=[background=#002D93];
define loan / display style(header)=[background=#1F51B7];
define m2 / display style(header)=[background=#4375DB];
define m3 / display style(header)=[background=#6799FF];
define m4 / display style(header)=[background=#8BBDFF];
define m5 / display style(header)=[background=#9DCFFF];
define m6 / display style(header)=[background=#C1F3FF];
compute year ;
if year gt ' ' then
call define(_row_,'style',
'style={bordertopcolor=black bordertopwidth=1}');
endcomp;
run;
ods excel close;

 

 

캡처1.JPG

In the SAS report output, It appears horizontal lines that separating years.

 

But when I execute Excel, I cannot found any lines...

캡처2.JPG

 

How can I add horizontal lines in my ODS excel output? 

Super User
Posts: 10,194

Re: ODS Excel Output

[ Edited ]

Try 

compute year ;
if year gt ' ' then
call define(_row_,'style',
'style={bordertopcolor=darkblack bordertopwidth=1}');
endcomp;

 

or try another style:

style={bordertoptype=

 

or use LINE statement:

computer after year/ style(line)={background=black};

line ' ';

endcomp;

Ask a Question
Discussion stats
  • 1 reply
  • 151 views
  • 0 likes
  • 2 in conversation