BookmarkSubscribeRSS Feed
dbayn
Calcite | Level 5

Hi all,

I'm using the report writing interface to output a table to pdf. Is there a way to rotate the headers so that the text is vertical? I don't need anything to span multiple columns or rows or anything, I just need the text rotated. 

I'm currently using: ods pdf

Report writing interface

9.3, Windows

Thanks,

Danni

2 REPLIES 2
Cynthia_sas
SAS Super FREQ

Hi:

  I do not know whether rotation is a style attribute that you can apply to text using the Report Writing Interface, that is a question to be answered by the doc or by Tech Support. However, even without the Report Writing Interface, you can produce vertical headers automatically with PROC PRINT (see #1) or for only some variable labels with PROC REPORT (see #2) or using ODS ESCAPECHAR for other procedures, like PROC FREQ (see #3).

Cynthia

options topmargin=.25in bottommargin=.25in;
ods pdf file='c:\temp\vertical_headers.pdf' style=printer startpage=no;
ods escapechar='^';
 
  proc print data=sashelp.class(obs=2) heading=v noobs label;
    title '1) PROC PRINT';
    var name age sex height weight;
    label name = 'Long Label for Name'
          height = 'How Tall Student Is';
  run;
  title;
   
  proc report data=sashelp.class(obs=2) nowd split='#';
    column name age sex height weight;
    define name / order 'L#o#n#g# #L#a#b#e#l# #f#o#r# #N#a#m#e';
    define height / 'H#o#w# #T#a#l#l# #S#t#u#d#e#n#t# #I#s';
    compute before _page_;
      line '2) PROC REPORT with SPLIT char';
    endcomp;
  run;

 

  ods pdf startpage=now;
  run;

     

  ** ^n is the original "newline" ESCAPECHAR instruction;
  ** alternate method is ^{newline 1}, which is more typing;
  proc freq data=sashelp.class;
    title '3) PROC FREQ Label with ODS ESCAPECHAR';
    table age;
    label age='T^nh^ne^n^_^nA^ng^ne^n';
  run;
ods pdf close;


compare_PRINT_REPORT_vertical_headers.pngvertical_headers_proc_freq.png
dbayn
Calcite | Level 5

Thank you!

It's not quite what I'm looking for, so I'll contact tech support, but it is good to know the other available options if there isn't an official style attribute for it.

Thanks again! Smiley Happy

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