BookmarkSubscribeRSS Feed
Zandi
Calcite | Level 5

Dear all,

 

I want to rotate column headers (90 deg) in proc report and the output should be in a pdf file. example of my code is as below.

%LET Reports = \\him\DataStore\Internal\HIM_Water_Quality_Administration\GPsites\Catchment;

ODS _ALL_ Close;
ODS ESCAPECHAR = '~'; 
ODS pdf FILE = "&Reports\test&pdf_file" ;


PROC REPORT DATA=sashelp.cars split='*' spanrows 
 	  style (column) = [fontsize=5.5pt /*cellheight=0.15in*/ font=("Arial",18pt,Normal)]
      style (header) = [fontsize=5.5pt /*backgroundcolor = lightblue*/ fontweight = bold cellheight = 18.08mm 
						font=("Arial",18pt,Normal) frame=void htmlstyle="mso-rotate:90; height:50pt"]
      style (report) = [fontsize=5.5pt /*cellheight = 0.15in*/ font=("Arial",18pt,Normal) borderColor=BLACK] /*headline ls=100*/;

	  title1 j=l font=Arial bold height=1.2 cars;
where make in ('Acura', 'Audi');
column  make type EngineSize Cylinders Horsepower Weight;
DEFINE make/ 'make' group STYLE(COLUMN) = [cellheight = 0.15IN vjust=middle JUST = left ];
DEFINE type/'type' group STYLE (COLUMN) =[width=15% cellheight = 0.15IN font=("Arial",12pt,Normal) vjust=center];
DEFINE EngineSize/'EngineSize' order DISPLAY  STYLE (COLUMN) = [CELLWIDTH = 0.3IN cellheight = 0.15IN JUST = l font=("Arial",12pt,Normal)];
DEFINE Cylinders/'Cylinders' DISPLAY  STYLE (COLUMN) = [CELLWIDTH = 0.3IN cellheight = 0.15IN JUST = l font=("Arial",12pt,Normal)];
DEFINE Horsepower/'Horsepower' DISPLAY  STYLE (COLUMN) = [CELLWIDTH = 0.3IN cellheight = 0.15IN JUST = l font=("Arial",12pt,Normal)];
DEFINE Weight/'Weight' DISPLAY  STYLE (COLUMN) = [CELLWIDTH = 0.3IN cellheight = 0.15IN JUST = l font=("Arial",12pt,Normal)];

RUN;

The below statement yield the desired output, however it is in word not in pdf

ods tagsets.rtf file="&Reports\Blesbokspruit Catchment.pdf"
OPTIONS(TRHDR="\trrh2750"
TROWHDRCELL="\cltxbtlr" ) style=styles.minimal;
2 REPLIES 2
Zandi
Calcite | Level 5
Hi Cindy,
I am unable to access the link on your response, could you please attached a copy of the paper.
http://www.nesug.org/Proceedings/nesug03/at/at007.pdf
Thank you

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1785 views
  • 0 likes
  • 2 in conversation