The SAS Output Delivery System and reporting techniques

Vertical column headings in proc report

Reply
Contributor
Posts: 44

Vertical column headings in proc report

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?
SAS Super FREQ
Posts: 8,740

Re: Vertical column headings in proc report

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
Contributor
Posts: 44

Re: Vertical column headings in proc report

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.
SAS Super FREQ
Posts: 8,740

Re: Vertical column headings in proc report

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
Contributor
Posts: 44

Re: Vertical column headings in proc report

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;
SAS Super FREQ
Posts: 8,740

Re: Vertical column headings in proc report

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
Contributor
Posts: 44

Re: Vertical column headings in proc report

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.
SAS Super FREQ
Posts: 8,740

Re: Vertical column headings in proc report

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
Ask a Question
Discussion stats
  • 7 replies
  • 1219 views
  • 0 likes
  • 2 in conversation