The SAS Output Delivery System and reporting techniques

Styling Headers in Proc Report

Accepted Solution Solved
Reply
Super User
Posts: 17,865
Accepted Solution

Styling Headers in Proc Report

Is there a way to style part of a header a different style than the rest of the header?

In the following example is it possible to have STATS bigger (say 14pt, Arial and bold, not italicized)?

ods pdf file="C:\temp\test.pdf" style=journal;

proc report data=sashelp.class nowd;

column name ('Stats' weight age height);

run;

ods pdf close;


Accepted Solutions
Solution
‎02-12-2013 09:42 PM
SAS Super FREQ
Posts: 8,743

Re: Styling Headers in Proc Report

Hi:

  There are 2 methods that I'm aware of:

1) change all the HEADERS in the PROC REPORT statement and then override individual headers for selected column in the DEFINE statement or

2) use ODS ESCAPECHAR in the PROC REPORT statement

  I'm sort of a control freak, so I tend to use Method 1, but Method 2 is perfectly acceptable too. My only comment is that I don't use Arial (a Microsoft specific font) with PDF. I think that to force PDF to use Arial, you have to specify it as: "Arial Unicode MS", which is way more typing than Helvetica, which seems to be the font that PDF is happiest with.

cynthia

ods listing close;
ods pdf file="C:\temp\test.pdf" style=journal;
 
proc report data=sashelp.class nowd
     style(header)={font_face='Helvetica' font_size=14pt
                    font_style=roman font_weight=bold};
title 'Method 1';
column name ('Stats' weight age height);
define name / order
       style(header)={font_face='Helvetica' font_size=10pt font_weight=bold};
define weight / order
       style(header)={font_face='Helvetica' font_size=10pt font_weight=bold};
define age / order
       style(header)={font_face='Helvetica' font_size=10pt font_weight=bold};
define height / order
       style(header)={font_face='Helvetica' font_size=10pt font_weight=bold};
run;
  
ods escapechar='~';
  
proc report data=sashelp.class nowd;
title 'Method 2';
column name ("~{style[font_face='Helvetica' font_size=14pt font_style=roman font_weight=bold]Stats}"
              weight age height);
run;

ods pdf close;

View solution in original post


All Replies
Solution
‎02-12-2013 09:42 PM
SAS Super FREQ
Posts: 8,743

Re: Styling Headers in Proc Report

Hi:

  There are 2 methods that I'm aware of:

1) change all the HEADERS in the PROC REPORT statement and then override individual headers for selected column in the DEFINE statement or

2) use ODS ESCAPECHAR in the PROC REPORT statement

  I'm sort of a control freak, so I tend to use Method 1, but Method 2 is perfectly acceptable too. My only comment is that I don't use Arial (a Microsoft specific font) with PDF. I think that to force PDF to use Arial, you have to specify it as: "Arial Unicode MS", which is way more typing than Helvetica, which seems to be the font that PDF is happiest with.

cynthia

ods listing close;
ods pdf file="C:\temp\test.pdf" style=journal;
 
proc report data=sashelp.class nowd
     style(header)={font_face='Helvetica' font_size=14pt
                    font_style=roman font_weight=bold};
title 'Method 1';
column name ('Stats' weight age height);
define name / order
       style(header)={font_face='Helvetica' font_size=10pt font_weight=bold};
define weight / order
       style(header)={font_face='Helvetica' font_size=10pt font_weight=bold};
define age / order
       style(header)={font_face='Helvetica' font_size=10pt font_weight=bold};
define height / order
       style(header)={font_face='Helvetica' font_size=10pt font_weight=bold};
run;
  
ods escapechar='~';
  
proc report data=sashelp.class nowd;
title 'Method 2';
column name ("~{style[font_face='Helvetica' font_size=14pt font_style=roman font_weight=bold]Stats}"
              weight age height);
run;

ods pdf close;

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 204 views
  • 0 likes
  • 2 in conversation