The SAS Output Delivery System and reporting techniques

Help in rotating headers in Excel ???

Posts: 0

Help in rotating headers in Excel ???

I'm trying to rotate the variable names in my excel output so that my
report looks compact. Right now I have to scroll left as my var names
are too big.

HEre is what I'm using :

proc print data=Visit1
style(report)={rules=none }
style(header)={font_weight=bold htmlstyle="mso-rotate:90;cellheight:
border-bottom:5px double red;
border-left:none;border-right:none;border-top:5px double red"

Using this I was able to rotate the var names 90 degrees but I see lot
of empty space which makes the var names row too big than the others.
If I decrease the height var names get over lapped. Also I want to
justify them to the the bottom end(I'm not sure if left/ right).

Appreciate you help....

Posts: 8,740

Re: Help in rotating headers in Excel ???

What is specified in the HTMLSTYLE= attribute are standard CSS property/value attributes -- with the exception of mso-rotate -- which is a Microsoft specific CSS property. So there are 2 things needed to answer this question using the HTMLSTYLE approach:
1) Is there a "standard" CSS selector that will do what you want? (vertical align??)
2) Will Excel respect the CSS property? Does Microsoft have a different CSS property that would be better to use?

The Microsoft documentation which includes their list of "mso" CSS properties can be found here:

You have to download the whole Office HTML and XML "package" to get at the piece you want.

On the other hand, you could try the SAS style attribute approach, just as you have font_weight=bold and background=_undef_, you could try something like:
style(header)={verticalalign=b font_weight=bold ....};

which uses SAS style attributes (not CSS style specifications) to make the change. It may be that you'll find the SAS style attribute is not honored by Excel -- but I think that this is one of the attributes that will work in Excel. However, I generally start with the SAS style attributes first and then move to the CSS/Microsoft CSS attributes and HTMLSTYLE if the SAS style doesn't work.


ps...actually, I can't remember whether the attribute is VERTICALALIGN or VALIGN ... but the specification for bottom is B. There's a section in the doc entitled "Style Attributes and Their Values" which is where you'd find the exact attribute name.
Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation