The SAS Output Delivery System and reporting techniques

Left-Justify Spanning Header

Reply
Frequent Contributor
Posts: 80

Left-Justify Spanning Header

Hello!

I am looking to left justify a spanning header in proc report using RTF. The lowest header I can get left justified by doing:

define labTest / order style = [just = l] 'Laboratory Test';

However, I cannot get something similar for a spanning header. I've tried the code below and it does not work (for me). ` is my escape character.

columns ('`{style [just=left] Baseline Result}' baseInd fuInd);
SAS Super FREQ
Posts: 8,744

Re: Left-Justify Spanning Header

Hi:
I can think of 2 methods:
1) Left-justify the default for ALL headers, including the spanning header, in the PROC REPORT statement and then in the DEFINE statement, change the ones you do NOT want left justified;

2) use COMPUTE BEFORE _PAGE_ with a style override for the justification -- this will span ALL the columns in the column statement -- not just 2 columns, however.

cynthia
[pre]
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 ('BaseLine Results' age name) 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};
define weight / display style(header)={just=c cellwidth=1.25in};
run;
ods _all_ close;

ods rtf file='c:\temp\usecompute2.rtf';
title "2) Use COMPUTE BEFORE";
proc report data=sashelp.class nowd
style(header)={just=l};
column age name 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};
define weight / display style(header)={just=c cellwidth=1.25in};
compute before _page_/ style=Header{just=l};
line 'BaseLine Results';
endcomp;
run;
ods _all_ close;
[/pre]
Ask a Question
Discussion stats
  • 1 reply
  • 3044 views
  • 3 likes
  • 2 in conversation