The SAS Output Delivery System and reporting techniques

Error adding template background images

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 10
Accepted Solution

Error adding template background images

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.


Accepted Solutions
Solution
‎05-05-2017 11:21 AM
Super User
Posts: 19,192

Re: Error adding template background images

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


All Replies
Super User
Posts: 11,141

Re: Error adding template background images

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

Occasional Contributor
Posts: 10

Re: Error adding template background images

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.

Solution
‎05-05-2017 11:21 AM
Super User
Posts: 19,192

Re: Error adding template background images

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.

Occasional Contributor
Posts: 10

Re: Error adding template background images

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

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 188 views
  • 0 likes
  • 3 in conversation