BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi,
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:
5pt;cellwidth:5pt;
border-bottom:5px double red;
border-left:none;border-right:none;border-top:5px double red"
background=_undef_};
run;

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....

Regards,
Eddie
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:
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:
http://msdn.microsoft.com/en-us/library/aa155477(office.10).aspx

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:
[pre]
style(header)={verticalalign=b font_weight=bold ....};
[/pre]

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.

cynthia

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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

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
  • 1 reply
  • 828 views
  • 0 likes
  • 2 in conversation