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;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.