The SAS Output Delivery System and reporting techniques

Rotated Text Heading in Proc Report

Reply
Contributor
Posts: 42

Rotated Text Heading in Proc Report

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
Super Contributor
Posts: 394

Re: Rotated Text Heading in Proc Report

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

Re: Rotated Text Heading in Proc Report

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]
Contributor
Posts: 42

Re: Rotated Text Heading in Proc Report

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