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;
In the SAS report output, It appears horizontal lines that separating years.
But when I execute Excel, I cannot found any lines...
How can I add horizontal lines in my ODS excel output?
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;
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.