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;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.