BookmarkSubscribeRSS Feed
AndersBergquist
Quartz | Level 8
I am trying to get vertical headings in a proc report heading. I like to have the headings in a 90 degree angle to the table. This is like the distants tables in Atlas.

I have not fund a way to do it, does someone of You know how to do?
7 REPLIES 7
Cynthia_sas
SAS Super FREQ
Hi:
PROC PRINT automatically has an option to make the headers vertical. PROC REPORT requires that you use the techniques in this previous posting. Keep in mind that the ODS ESCAPECHAR method in this forum posting only works for ODS destinations that support style (which EXCLUDES the LISTING destination).

http://support.sas.com/forums/thread.jspa?messageID=7928Ỹ

cynthia
AndersBergquist
Quartz | Level 8
Thanks for the response. I will check out the rtf-paper. The escapcaracter n will not work for me because I need to verticalize an across variable and I will have the text turn 90 degrees, not the latters standing on top of each other.

In my case, this is not something I will do because it exist or some unecessary thing, or feature request, it is a very usefull feature. We have 16 railway stations and 36 deparatures each day (and directions). The only way to make them representated in a propoer way is to put the station name in top and the departures on the left. And reading from left to rigth You can follow the numbers who boarded the train, or the numbers onboard. The only way to make it fit, is to put the name of the railway stations vertical.

The railway stations is familar to everybody so there is no problem to read the text and I will not publish it on an official website so the argument about screen readers is not valid.

Just some comments about these request as unecessary and as an example of bad habit.
Cynthia_sas
SAS Super FREQ
Hi:
Yes, I agree. That sounds like you really need to rotate the headers.

There is a mso-rotate style attribute that allows rotation, but I believe it only works for Excel and not for Word. The RTF method may be the only method available to you. You will need to turn PROTECTSPECIALCHARS=OFF in order to send the RTF control string from ODS to RTF without ODS trying to "protect" the special characters. There should be an example of this in the referenced paper.

cynthia
AndersBergquist
Quartz | Level 8
Maybe this is the best rtf-solution, from support.sas.com

Column Header Rotation
The OPTIONS statement can be used for manipulating the RTF table row instructions. The following code snippet rotates the column header.

options orientation=landscape nodate nonumber;
ods listing close;

ods tagsets.rtf file="Mrotate.rtf"

OPTIONS(TRHDR="\trrh750"
TROWHDRCELL="\cltxbtlr"
TROWD="\rtlrow" );

proc print data=sashelp.class(obs=5); run;

ods _all_ close;
Cynthia_sas
SAS Super FREQ
Hi:
You may have to download tagsets.rtf which is experimental or pre-production in SAS 9.1 and production in SAS 9.2. I'm not sure whether that snippet of RTF code would work in the original ODS RTF (probably not, since ODS RTF does not have an OPTIONS capability).

cynthia
AndersBergquist
Quartz | Level 8
Thanks,
I think this is one common answer to most of my questions, "it will come in the next version at autom." 😉

I will try to experiment with mso-rotate and also investigate the tagset-rtf.
Cynthia_sas
SAS Super FREQ
Hi:
One workaround that my students have told me about (when they need to do something based on an RTF file (like selectively double underline one header)) is to generate the table in "regular" RTF and then run a VB script or Word macro to perform the changes they want and resave the file as a .DOC file.

cynthia

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 7 replies
  • 3154 views
  • 0 likes
  • 2 in conversation