The SAS Output Delivery System and reporting techniques

with excelXP align tabulate row title in middle

Reply
N/A
Posts: 0

with excelXP align tabulate row title in middle

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
SAS Employee
Posts: 95

Re: with excelXP align tabulate row title in middle

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;
N/A
Posts: 0

Re: with excelXP align tabulate row title in middle

many thanks

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

Peter
Ask a Question
Discussion stats
  • 2 replies
  • 136 views
  • 0 likes
  • 2 in conversation