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

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

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.

View solution in original post

4 REPLIES 4
ballardw
Super User

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

ljaeger
Fluorite | Level 6

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.

Reeza
Super User

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.

ljaeger
Fluorite | Level 6

It worked!   You are god-like in your knowledge!  Many thanks!

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
  • 4 replies
  • 2250 views
  • 0 likes
  • 3 in conversation