BookmarkSubscribeRSS Feed
elsfy
Quartz | Level 8

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 : 

isgnr_0-1652197824184.png

 

When exporting it with ODS EXCEL, Excel does whatever it wants and displays it like this : 

isgnr_1-1652197862549.png


While i want an output looking like this : 

isgnr_2-1652198082442.png

 

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 ; 
5 REPLIES 5
Ksharp
Super User

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;

Ksharp_0-1652240567524.png

 

elsfy
Quartz | Level 8
Thank you, really close to what i want. Is it possible to put 'Performing time' under 'Category(before change/extension)' ?
Ksharp
Super User

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;

Ksharp_0-1652262940272.png

 

Ksharp
Super User

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;

Ksharp_0-1653054934258.png

 

SAS Innovate 2025: Call for Content

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!

Submit your idea!

SAS Enterprise Guide vs. SAS Studio

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 717 views
  • 4 likes
  • 2 in conversation