Hi everyone, I'm attempting to insert images into a report I'm writing with report writing interface via URL. A specific image needs to be in every region on a page, and the image is stored on a web server. I use obj.image(file: myurl) and got the error unable to load image...default image will be used. Resources on image inserting via url don't seem to be plentiful. Any help and examples are much appreciated, and I'd also like to know if this image will be automatically sized to fit the region, and if not, how to can specify it's dimensions!
Thanks!
obj.region(
width:"1.9in", height: "3.2in",
x : "0in", y: "0in",
style_attr: "background=grey color=grey"
);
obj.image(file: 'my.com/url');
Hi:
This example worked for me. It is a picture of Lewis Carroll available at a URL. I needed a fully qualified HTTP address for the URL.
cynthia
ods pdf file='c:\temp\testurl.pdf' notoc;
data _null_;
length pixloc $256;
if _n_ = 1 then do;
pixloc='http://img.bhs4.com/45/e/45e71f0d91fb0b65b98b129552466d58c2e46d6d_large.jpg';
end;
if _n_ = 1 then do;
dcl odsout obj();
obj.layout_gridded(columns:1);
end;
obj.region(width:"3.25in");
obj.image(file: pixloc ,
overrides:"just=left width=100pct");
if eof eq 1 then
obj.layout_end();
run;
ods pdf close;
Hi:
This example worked for me. It is a picture of Lewis Carroll available at a URL. I needed a fully qualified HTTP address for the URL.
cynthia
ods pdf file='c:\temp\testurl.pdf' notoc;
data _null_;
length pixloc $256;
if _n_ = 1 then do;
pixloc='http://img.bhs4.com/45/e/45e71f0d91fb0b65b98b129552466d58c2e46d6d_large.jpg';
end;
if _n_ = 1 then do;
dcl odsout obj();
obj.layout_gridded(columns:1);
end;
obj.region(width:"3.25in");
obj.image(file: pixloc ,
overrides:"just=left width=100pct");
if eof eq 1 then
obj.layout_end();
run;
ods pdf close;
I'm getting the following errors when running the code:
ERROR: Unable to load image
http://img.bhs4.com/45/e/45e71f0d91fb0b65b98b129552466d58c2e46d6d_large.jpg;
default image will be used instead.
The log file also has the following warning:
WARNING: ODS Report Writing Interface is not supported for TAGSETS.SASREPORT13(EGSR) destination. Results may be unpredictable.
However I've used RWI to generate reports on this machine/server before (Never with images though).
Any insights?
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.