BookmarkSubscribeRSS Feed
jcbell
Obsidian | Level 7
Does anyone know if there is a way to get Proc Report to render rotated text that spans multiple rows?


I have a requirement from a customer to create a PDF report. The first cell in the report has a text description that runs vertically (the text) and spans 5 rows of data.

My only thought is to make an image and use pre-image to load it into a cell. However, I'm not sure I can get the image to span multiple rows.

Any ideas?


Thanks,


John
3 REPLIES 3
Tim_SAS
Barite | Level 11
I'm not aware of any way to do this with PROC REPORT. If it can be done at all, it would have to be via DATA _NULL_ and ODS Object Oriented features (http://www2.sas.com/proceedings/sugi28/022-28.pdf). I'd suggest consulting with Tech. Support if you want to try that avenue.
Cynthia_sas
SAS Super FREQ
Hi:
This really isn't a rotated header, so much as a "put every character in the header on a separate line" solution. Basically, you put a "line feed" between every character in the spanning header. Proc Report will do a spanning header for you. See #1 report. Then, using ODS ESCAPECHAR, you can put a line feed between every letter in the header. See #2 report. The "line feed" is the ODS ESCAPECHAR + n...so if ESCAPECHAR is ^, then ^n is the line feed.

Tech Support may have some other ideas. This is sort of the "brute force" method.

cynthia
[pre]
ods pdf file='fake_vertical1.pdf';
ods escapechar='^';
proc report data=sashelp.class nowd;
title '1) Make Spanning Header -- not vertical';
column ('SPAN - HDR' name age height weight sex) x y z;
define name / order 'Name';
define age / order 'Age';
define height / sum;
define weight / sum;
define sex / display;
define x / computed 'X';
define y /computed 'Y';
define z / computed 'Z';
compute x;
x = age * 100 + height.sum;
endcomp;
compute y;
y = age * 25 + weight.sum;
endcomp;
compute z;
z = age * 73 + height.sum + weight.sum;
endcomp;
run;
ods pdf close;

ods pdf file='fake_vertical2.pdf';
ods escapechar='^';
proc report data=sashelp.class nowd;
title '2) Use line feed between each character';
column ('S^nP^nA^nN^n-^nH^nD^nR' name age height weight sex) x y z;
define name / order 'Name';
define age / order 'Age';
define height / sum;
define weight / sum;
define sex / display;
define x / computed 'X';
define y /computed 'Y';
define z / computed 'Z';
compute x;
x = age * 100 + height.sum;
endcomp;
compute y;
y = age * 25 + weight.sum;
endcomp;
compute z;
z = age * 73 + height.sum + weight.sum;
endcomp;
run;
ods pdf close;
[/pre]
jcbell
Obsidian | Level 7
Thank you both for the response.


Tim - Your suggestion worked - It took a bit of coding, but I was able to produce the report within reason of the requirements. I used images for the "rotated row headers" and absolute layout to align the images and have them appear to span several rows.


Thanks!


-John

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 2536 views
  • 0 likes
  • 3 in conversation