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

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;

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
Diamond | Level 26

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

1 REPLY 1
Cynthia_sas
Diamond | Level 26

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;

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

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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