BookmarkSubscribeRSS Feed
deleted_user
Not applicable
The Doc that comes with excelXP doc='help' indicates the impressive scope provided by this tagset. However, I seem unable to persuade the class level values to appear anywhere than on the last row of the class level. What am I missing? Here is some code to demonstrate what I seek: [PRE]
ods _all_ close ;
ods tagsets.excelxp file="demo.rts.alignment.xls" ;
ods html file="demo.rts.alignment.html" ; * for comparison;
proc tabulate data= sashelp.class format= 3. ;
class sex name ;
classlev sex name /STYLE=[just=center vjust=middle] ; *effective on html ;
table sex*name, n ;
run;
ods _all_ close;
[/pre]

Peter
2 REPLIES 2
Eric_SAS
SAS Employee
There is no way for the tagset to know that you are giving an over ride for the justification. In excel, justification is part of the style definition. So this causes special problems that could lead to enormous style definitions.

The tagset could be coded to handle this, but it's already slow and I'm
hesitant to add more processing for this case when there is a good
work around.

Currently, to change the justification you need to create a style element with the justification you desire.

This will do what you want.

proc template;
define style styles.mystyle;
parent=styles.default;

style classlev from header/
vjust=middle
just=center
;
end;
run;



ods _all_ close ;
ods tagsets.excelxp file="demo.rts.alignment.xls" style=mystyle;
ods html file="demo.rts.alignment.html" style=mystyle; * for comparison;
proc tabulate data= sashelp.class format= 3. ;
class sex name ;
classlev sex name /STYLE=classlev ; *effective on html ;
table sex*name, n ;
run;
ods _all_ close;
deleted_user
Not applicable
many thanks

That is the logical solution. It works perfectly.
I'm still learning the direction I should look to adjust appearance.

Peter

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1022 views
  • 0 likes
  • 2 in conversation