I am using SAS9.2, and I have some picture files of charts (not produced with sasgraph) in both .emf and .png format. I would like to drop them all into a single file to email out. I have tried ods rtf/pdf/html output all for both. PNG images are too grainy in each ODS destination to read text overlaid on the charts, and I receive the following errors for .EMF depending on the ODS destination. Any help would be much appreciated! Ultimately I am relatively indifferent to printing to pdf, html or rtf as long as I can size the images appropriately and have them be readable.
-----------------------------------------------------------------
I am using a dummy dataset and preimage to print the images (code snippet below):
options orientation=landscape;
ods html file="&Output\testreport.html" style=HighContrast;
ods layout start columns=1 column_widths=(7in);
data dummy; x='"'; run; /*dummy data file to print chart images as backgrounds to empty proc report pages*/
proc report data=dummy nowd; Title; column x; define x /'' style=[preimage="&picturespath.&fuelpricechart.&reportdate.&ext."]; run;
proc report data=dummy nowd; Title; column x; define x /'' style=[preimage="&picturespath.&stockpricechart.&reportdate.&ext."]; run;
proc print data=dataset1;
Title "Title for Dataset1";
run;
ods html close;
ods layout end;
Max
You might try ODS TAGSETS.MSOFFICE2K but I'm guessing here.
I would try a very basic document with no options or layout to start.
Hi:
I saw -almost- the same thing. PDF gave me an error message:
ERROR: Image file type is not supported, or corrupted file.
ERROR: Unable to load image c:\temp\kermit.emf.
ERROR: Unable to load image c:\temp\kermit.emf; default image will be used instead.
NOTE: There were 1 observations read from the data set WORK.DUMMY.
The RTF file did not contain any images.
I was able to get an HTML file with a valid IMG tag for both pictures. I used slightly different syntax than you did. IMAGE_DPI didn't seem to have any impact on how the pictures looked.
I put in the same file twice (KERMIT.EMF) -- the resolution was not good - -certainly, it didn't look as good in the HTML file as the original HTML file.
Below is the code I used. You say that these pictures were created by some other process. You might try annotating them into a new image using SAS/GRAPH Annotate facility. Or you might try working with Tech Support on this question. I'm not sure that using PROC REPORT is the right approach. But if there is a way to do what you want, Tech Support will be able to point you in the right direction. And if there's not a way to do what you want, they will save you a lot of failed attempts.
I put my image in c:\temp\kermit.emf and wrote my output there, too.
cynthia
data dummy;
x = '_';
run;
ods html path='c:\temp' (url=none) file="showkermit.html"
style=HighContrast ;
Title "Title for Dataset1";
proc report data=dummy nowd noheader
style(report)={outputwidth=100% rules=none frame=void
cellspacing=0
preimage="kermit.emf"};
column x;
define x /''
style(column)=[background=white just=c
foreground=white
preimage="kermit.emf"];
run;
ods _all_ close;
ods rtf file='c:\temp\showkermit.rtf' ;
ods pdf file='c:\temp\showkermit.pdf' ;
Title "Title for Dataset1";
proc report data=dummy nowd noheader
style(report)={outputwidth=100%
preimage="c:\temp\kermit.emf"};
column x;
define x /''
style(column)=[background=white just=c
foreground=white
preimage="c:\temp\kermit.emf"];
run;
ods _all_ close;
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.