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
SAS Super FREQ

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
SAS Super FREQ

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;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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