I try to add box line when ods excel and proc report with style=minimal.
Code is.
ods excel file= "/home/sasondemand/test_ods_excel.xlsx"
style =minimal
;
proc report data=sashelp.class(obs=10)
style( report ) = [ background=blue frame=box ]
;
column sex name age height weight;
define sex / order;
run;
ods excel close;
After submit, output window seems nice.
But output excel is not match.
What I want is like this, say simple and just outside boundary for "style(report) =[ frame=box ]"
When I check this problem, found that "style=minimal" is occasionalley not good.
Is there any way for simple looks and "style(report)" is valid.
I can leave "style=minimal" if it have simple looks.
Regards
Partially, I think the issue is the style chosen, Minimal.
This code, using style=Meadow, will put vertical borders on the table:
ods excel file= "&outpath.\test_ods_excel.xlsx" style=meadow ; proc report data=sashelp.class(obs=10) ; column sex name age height weight; define sex / order style=[borderleftcolor=blue borderleftwidth=2mm]; define weight / style=[borderrightcolor=blue borderrightwidth=2mm]; run; ods excel close;
But style Minimal, Journal and Analysis so likely others, don't show the right/left border. So the style has some impact.
Some additional overrides, with the right style, may get the top part of the frame.
ods excel file= "&outpath.\test_ods_excel.xlsx" style=meadow ; proc report data=sashelp.class(obs=10) ; column sex name age height weight; define sex / order style=[borderleftcolor=blue borderleftwidth=2mm] style(header)=[bordertopcolor=blue bordertopwidth=2mm borderleftcolor=blue borderleftwidth=2mm]; define name / style(header)=[bordertopcolor=blue bordertopwidth=2mm]; define age / style(header)=[bordertopcolor=blue bordertopwidth=2mm]; define height/ style(header)=[bordertopcolor=blue bordertopwidth=2mm]; define weight / style=[borderrightcolor=blue borderrightwidth=2mm] style(header)=[bordertopcolor=blue bordertopwidth=2mm borderrightcolor=blue borderrightwidth=2mm]; run; ods excel close;
Partially, I think the issue is the style chosen, Minimal.
This code, using style=Meadow, will put vertical borders on the table:
ods excel file= "&outpath.\test_ods_excel.xlsx" style=meadow ; proc report data=sashelp.class(obs=10) ; column sex name age height weight; define sex / order style=[borderleftcolor=blue borderleftwidth=2mm]; define weight / style=[borderrightcolor=blue borderrightwidth=2mm]; run; ods excel close;
But style Minimal, Journal and Analysis so likely others, don't show the right/left border. So the style has some impact.
Some additional overrides, with the right style, may get the top part of the frame.
ods excel file= "&outpath.\test_ods_excel.xlsx" style=meadow ; proc report data=sashelp.class(obs=10) ; column sex name age height weight; define sex / order style=[borderleftcolor=blue borderleftwidth=2mm] style(header)=[bordertopcolor=blue bordertopwidth=2mm borderleftcolor=blue borderleftwidth=2mm]; define name / style(header)=[bordertopcolor=blue bordertopwidth=2mm]; define age / style(header)=[bordertopcolor=blue bordertopwidth=2mm]; define height/ style(header)=[bordertopcolor=blue bordertopwidth=2mm]; define weight / style=[borderrightcolor=blue borderrightwidth=2mm] style(header)=[bordertopcolor=blue bordertopwidth=2mm borderrightcolor=blue borderrightwidth=2mm]; run; ods excel close;
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.