BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
morglum
Quartz | Level 8

Hi everyone,

I'd like the first spanned header to be left-aligned and the second one to be centered.  How can I  style spanned headers independently?

 

thanks!

 

 

 

edit: I'm using distinct columns to generate the report, not ACROSS.

 edit2: here's a minimal non-working example stolen from another thread:

ods listing close;

ods rtf file='c:\temp\usestyle1.rtf';
title "1) Justify ALL the Headers Left and then change the ones you do NOT want left-just";
proc report data=sashelp.class nowd
style(header)={just=l};
column ('Left Justify' age name ) ('Right justify' height weight);
define age / order style(header)={cellwidth=1.25in} 'Laboratory Test';
define name / display style(header)={cellwidth=1.25in} 'The Name';
define height / display style(header)={just=c cellwidth=1.25in} 'height';
define weight / display style(header)={just=c cellwidth=1.25in} 'weight';
run;
ods _all_ close;

1 ACCEPTED SOLUTION

Accepted Solutions
morglum
Quartz | Level 8

Found it (obviously, after 2 days of searching and exactly 15 minutes after posting).  Just use an escape character like this:

 

ods escapechar='^';
ods listing close;

ods rtf file='c:\temp\usestyle1.rtf';
title "1) Justify ALL the Headers Left and then change the ones you do NOT want left-just";
proc report data=sashelp.class nowd
style(header)={just=l};
column ('Left Justify' age name ) ('^S={just=r} Right justify' height weight);
define age / order style(header)={cellwidth=1.25in} 'Laboratory Test';
define name / display style(header)={cellwidth=1.25in} 'The Name';
define height / display style(header)={just=c cellwidth=1.25in} 'height';
define weight / display style(header)={just=c cellwidth=1.25in} 'weight';
run;
ods _all_ close;

View solution in original post

1 REPLY 1
morglum
Quartz | Level 8

Found it (obviously, after 2 days of searching and exactly 15 minutes after posting).  Just use an escape character like this:

 

ods escapechar='^';
ods listing close;

ods rtf file='c:\temp\usestyle1.rtf';
title "1) Justify ALL the Headers Left and then change the ones you do NOT want left-just";
proc report data=sashelp.class nowd
style(header)={just=l};
column ('Left Justify' age name ) ('^S={just=r} Right justify' height weight);
define age / order style(header)={cellwidth=1.25in} 'Laboratory Test';
define name / display style(header)={cellwidth=1.25in} 'The Name';
define height / display style(header)={just=c cellwidth=1.25in} 'height';
define weight / display style(header)={just=c cellwidth=1.25in} 'weight';
run;
ods _all_ close;

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
  • 1 reply
  • 4849 views
  • 0 likes
  • 1 in conversation