Hi,
This is a problem i already wrote but couldn't find an answer so i am trying to be more clear on what i want.
I did a proc report adding headers above columns. The HTML output shown in SAS Entreprise Guide gives me this :
When exporting it with ODS EXCEL, Excel does whatever it wants and displays it like this :
While i want an output looking like this :
Here is part of my code :
ods excel file = ""
options(sheet_interval='none' embedded_titles='yes') ;
ods escapechar = '^' ;
options missing = 0 orientation=landscape center ;
proc report data = a split = '-'
style(header)={background=white borderwidth=1 bordercolor=black width=150 color=black just=c textalign=c}
style(report)={borderwidth=1 bordercolor=black just=c}
style(column)= {borderwidth=1 bordercolor=black just=r color=black tagattr='format:###,###,###,###,###0'}
style(summary)= [just=c textalign=c];
;
column ( '^{style[color=red]Total}' ('Category (before change/extension) - Performing time'
var1 var2 var3 );
define var1 / group;
define var2 / analysis sum ;
define var3 / analysis sum ;
run ;
Adding these three styles .
ods excel file = "c:\temp\temp.xlsx"
options(sheet_interval='none' embedded_titles='yes') ;
ods escapechar = '^' ;
options missing = 0 orientation=landscape center ;
proc report data =sashelp.class nowd split = '-'
style(header)={tagattr="wrap:no" vjust=m asis=on background=white borderwidth=1 bordercolor=black width=150 color=black just=c textalign=c}
style(report)={borderwidth=1 bordercolor=black just=c}
style(column)= {borderwidth=1 bordercolor=black just=r color=black tagattr='format:###,###,###,###,###0'}
style(summary)= [just=c textalign=c];
;
column ( '^{style[color=red]Total}' ('Category (before change/extension) - Performing time'
sex weight height ));
define sex / group;
define weight / analysis sum ;
define height / analysis sum ;
run ;
ods excel close;
Ha. That is really uneasy.
ods excel file = "c:\temp\temp.xlsx"
options(sheet_interval='none' embedded_titles='yes') ;
ods escapechar = '^' ;
options missing = 0 orientation=landscape center ;
proc report data =sashelp.class nowd split = '-'
style(header)={tagattr="wrap:no" background=white
bordertopwidth=1 bordercolor=black
borderrightwidth=1 borderrightcolor=black
color=black just=c textalign=c}
style(report)={borderwidth=1 bordercolor=black just=c}
style(column)= {borderwidth=1 bordercolor=black just=r color=black tagattr='format:###,###,###,###,###0'}
style(summary)= [just=c textalign=c];
;
column ( '^{style[color=red]Total}'
('^{style[borderwidth=1 bordercolor=white] Category (before change/extension)'
( '^{style[borderwidth=1 bordercolor=white] Performingtime'
sex weight height )));
define sex / group;
define weight / analysis sum ;
define height / analysis sum ;
run ;
ods excel close;
I just learn this option : flow="tables"
ods excel file = "c:\temp\temp.xlsx"
options(sheet_interval='none' embedded_titles='yes' flow="tables") ;
ods escapechar = '^' ;
options missing = 0 orientation=landscape center ;
proc report data =sashelp.class nowd split = '-'
style(header)={tagattr="wrap:no" background=white
bordertopwidth=1 bordercolor=black
borderrightwidth=1 borderrightcolor=black
color=black just=c textalign=c}
style(report)={borderwidth=1 bordercolor=black just=c}
style(column)= {borderwidth=1 bordercolor=black just=r color=black tagattr='format:###,###,###,###,###0'}
style(summary)= [just=c textalign=c];
;
column ( '^{style[color=red]Total}'
('^{style[borderwidth=1 bordercolor=white ] Category (before change/extension) - Performingtime'
sex weight height ) );
define sex / group ;
define weight / analysis sum ;
define height / analysis sum ;
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 16. Read more here about why you should contribute and what is in it for you!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: