BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
sum_sand
Calcite | Level 5
proc report data=sashelp.class;
   columns sex name ;
run;
 
 
ods path (prepend) work.template(update) sashelp.tmplmst;
 
 
proc template;
   define style custom_style;
      parent=styles.pearl; 
      style Document /
         margin=0.3in; 
      style Table /
         bordercolor=cxB0B7BB
         borderwidth=0.5pt
         borderstyle=solid; 
      class Header /
         backgroundcolor=lightblue height=40; /* Optional: Change header background color */
  class fonts /
    'TitleFont' = ("<MTsans-serif>, Albany",14pt,bold)
  'TitleFont2' = ("<MTsans-serif>, Albany",14pt,medium italic)
'docFont' = ("<MTsans-serif>, Albany",8pt);
     
 
   end;
run;
 
 
%let tdate =  %sysfunc(date(),mmddyy10.);
%let ttime= %sysfunc(time(),timeampm11.);
 
 
 
title; 
options nodate nonumber orientation=landscape papersize=letter  topmargin=.25in bottommargin=.25in leftmargin=.25in rightmargin=.25in;
 
/* Generate PDF report */
ods pdf file="&path.\dummy..pdf" 
notoc 
style=custom_style
startpage=no; 
 
/* Create the report */
proc report data=sashelp.class;
   columns sex name ;
   compute name;
      if sex='F' then call define(_col_,'style', 'style={background=pink}');
      else if sex='M'  then call define(_col_, 'style', 'style={background=cyan}');
   endcomp;
 
footnote1 H=0.01 j=right "^S={preimage='C:\Users\CDPH.jpg'}";
run;
 
ods pdf close; /* Close the PDF destination */

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

You may want to look at this post: https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-PDF-PRE-and-post-images-in-a-title-stateme...

There is some difference in the way the solution uses braces and brackets. Plus there might be a preference for POSTIMAGE with J=Right.

 

I am not sure what you want the H= 0.01 on the Footnote for but that might also be part of the issue if the image isn't appearing.

 

I have to assume that you have set ODS ESCAPECHAR='^'; somewhere as I don't see one. And that the image file exists in the stated location. If your SAS system runs on a server C: likely doesn't mean your harddrive.

View solution in original post

2 REPLIES 2
ballardw
Super User

You may want to look at this post: https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-PDF-PRE-and-post-images-in-a-title-stateme...

There is some difference in the way the solution uses braces and brackets. Plus there might be a preference for POSTIMAGE with J=Right.

 

I am not sure what you want the H= 0.01 on the Footnote for but that might also be part of the issue if the image isn't appearing.

 

I have to assume that you have set ODS ESCAPECHAR='^'; somewhere as I don't see one. And that the image file exists in the stated location. If your SAS system runs on a server C: likely doesn't mean your harddrive.

sum_sand
Calcite | Level 5

I was missing 

ODS ESCAPECHAR='^';

in my code. 

Thanks!

sas-innovate-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

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