Hi All,
I was able to place a png & htm file after running following code,
%let name=bar1;
FILENAME odsout "&_SASWS_/charts"; /* This allows me to output bar1.png being created in my home directory under charts */
goptions xpixels=480 ypixels=300 device=png noborder cback=white;
ods listing close;
ods HTML path=odsout body="&name..htm" style=minimal;
title;
footnote;
proc gchart data=running; vbar Date / sumvar=Mile_3 clipref frame type=sum
coutline=black raxis=axis1 maxis=axis2
des="" name="&name.";
run; quit;
Now how do I pull/read/access/fetch the file BAR1.png or BAR1.htm back in my proc report if I intend to email this image alongwith proc report output?
proc report data = running STYLE = [PREHTML = %UNQUOTE(%STR(%')
<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>
<td align="center"><strong>3 Mile Race Times</strong></td></tr>
<tr><td align="center">
<img src="what-do-I-mention-here" width="480" height="300"
align="middle" />
</td></tr></table>
%STR(%'))];
column Date Mile_1 Mile_2 Mile_3 Mile_4;
define Date / display;
define Mile_1 / display;
define Mile_2 / display;
define Mile_3 / display;
define Mile_4 / display;
run;
quit;
Anybody who could help please?
Regards,
Arpit
Ok, so preimage works fine,
proc report data = running STYLE=[PREIMAGE="&_SASWS_/charts/bar16.png"];
column <varlist>;
......
run;
quit;
but that's not what I am looking for(thank you for suggesting though, I didn't know).
Reason - I am interested to hit the source of image (.png in this case sitting at the home directory of SAS Studio Online account) and embed it in HTML under PROC REPORT so that when I send the output to any mobile device (irrespective of iPhone or adroid or screen size) the solution doesn't look messy, depending on platform we're sending output to.
Does this give a clear picture of the problem statement?
Reference link : http://support.sas.com/resources/papers/proceedings12/240-2012.pdf
You would want to replace
"&_SASWS_/charts"];
with
"&_SASWS_./charts"];
The Period after the _ denotes the end of the macro variable. Otherwise the macro processor looks for a macro variable named _SASWS_/CHARTS and will complain as the / is not valid in a macro variable name.
Since I don't know what &_SASWS_ might look like I'm not sure what modifications may be needed to get to be a valid src=argument.
??
There is no need to insert a period. Macro variable names cannot contain /.
In addition to @Oligolas's suggestion you may want to test the results of PREIMAGE in lieu of POSTIMAGE. You can get different appearance depending on order of insertion.
If you really want to embed your PNG file into the HTML data you are generating then you will need actually embed the content of the PNG file and NOT just code a link to a separate file.
http://www.techerator.com/2011/12/how-to-embed-images-directly-into-your-html/
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.