I'm trying to put a gradient background in a report, using a template. The SAS log keeps saying it can't load the image. I've googled this and not found an answer that helps, Here's the (simplified) code and the error.
proc template;
define style mystyle;
notes "My Simple Style";
class body /
backgroundimage='c:/users/ljaeger/my pictures/background-gradient-overlay-white.png'
color = black
fontfamily = "Palatino"
;
class systemtitle /
fontfamily = "Verdana, Arial"
fontsize = 16pt
fontweight = bold
;
class table /
backgroundcolor = #f0f0f0
bordercolor = black
borderstyle = solid
borderwidth = 1pt
cellpadding = 5pt
cellspacing = 0pt
frame = void
rules = groups
;
class header, footer /
backgroundcolor = #c0c0c0
fontfamily = "Verdana, Arial"
fontweight = bold
;
class data /
fontfamily = "Palatino"
;
end;
run;
ods pdf style=mystyle;
proc print data=e3;
run;
ods pdf close;
4426
4427 ods pdf style=mystyle;
NOTE: Writing ODS PDF output to DISK destination "C:\Users\LJaeger\sasprt.pdf", printer "PDF".
ERROR: Unable to load image c:/users/ljaeger/my pictures/background-gradient-overlay-white.png; default image will be used
instead.
4428 proc print data=e3;
4429 run;
NOTE: There were 18 observations read from the data set WORK.E3.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.02 seconds
cpu time 0.00 seconds
4430 ods pdf close;
NOTE: ODS PDF printed 1 page to C:\Users\LJaeger\sasprt.pdf.
Try moving the picture out of the My Docs folder, sometimes there's read/write restrictions under the directory.
Also, get the path by holding down SHIFT+Right Click the file, Copy As Path to ensure it's 100% correct.
OS syntax
NOTE: Writing ODS PDF output to DISK destination "C:\Users\LJaeger\sasprt.pdf", printer "PDF".
ERROR: Unable to load image c:/users/ljaeger/my pictures/background-gradient-overlay-white.png; default image
I was praying that you were right and I was just being stupid, but:
4746
4747 ods pdf style=mystyle;
NOTE: Writing ODS PDF output to DISK destination "C:\Users\LJaeger\sasprt.pdf", printer "PDF".
ERROR: Unable to load image c:/users/ljaeger/my pictures/background-gradient-overlay-white.png; default image will be used
instead.
4748 proc print data=e3;
4749 run;
NOTE: There were 18 observations read from the data set WORK.E3.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.02 seconds
cpu time 0.01 seconds
4750 ods pdf close;
NOTE: ODS PDF printed 1 page to C:\Users\LJaeger\sasprt.pdf.
Try moving the picture out of the My Docs folder, sometimes there's read/write restrictions under the directory.
Also, get the path by holding down SHIFT+Right Click the file, Copy As Path to ensure it's 100% correct.
It worked! You are god-like in your knowledge! Many thanks!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.