BookmarkSubscribeRSS Feed
deleted_user
Not applicable
In proc report and rtf ODS, is there a way wherein I can allign each column header (Left, Right or center). I know the style (header) gives us the option to allign all the coulmn headers, but not individual coulmn headers.

I am using the following syntax for style (header) and defining columns. I would like to left allign only the column header _NAME_ .


style(header)={BOTTOMMARGIN = 0IN cellheight=.15in font_face= "Times New Roman" font_size=9pt background=_undef_ font_weight= medium textalign=left}

columns PAGEIT PLAN PARA OR VISIT1 P CL _NAME_ ("^R/RTF'\brdrb\brdrs\brdrw1'Placebo &VAR2 |" Placebo CPLAC) EMPTY ("^R/RTF'\brdrb\brdrs\brdrw1'SB-5090 &VAR3|" _60_mg C60MG) ;
2 REPLIES 2
Cynthia_sas
SAS Super FREQ
Hi:
STYLE(HEADER) in the PROC REPORT statement will impact ALL column headers on the report output. But you can also use STYLE(HEADER) on a DEFINE statement in order to impact just one variable's header.

In the code below, I set OUTPUTWIDTH=100% so you can see the impact of the different justification options. Note how I can justify the individual headers separately from the data cells. Also, note how HEIGHT and WEIGHT use the default header justification in the absence of any other instructions on a DEFINE statement.

cynthia
[pre]
ods listing close;
ods rtf file='c:\temp\align_hdr.rtf';

proc report data=sashelp.class nowd
style(header)={just=c}
style(report)={outputwidth=100%};
column name sex age height weight;
define name / 'The Name'
style(header)={just=r}
style(column)={just=c};
define sex / 'Gender'
style(header)={just=l}
style(column)={just=r};
define age / 'Age'
style(header)={just=r}
style(column)={just=l};
run;

ods rtf close;
[/pre]

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