09-15-2016 11:50 PM
I was able to place a png & htm file after running following code,
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;
proc gchart data=running; vbar Date / sumvar=Mile_3 clipref frame type=sum
coutline=black raxis=axis1 maxis=axis2
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>
<img src="what-do-I-mention-here" width="480" height="300"
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;
Anybody who could help please?
09-16-2016 02:02 PM
Ok, so preimage works fine,
proc report data = running STYLE=[PREIMAGE="&_SASWS_/charts/bar16.png"];
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
09-16-2016 04:40 PM
You would want to replace
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.
09-16-2016 10:59 AM
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.
09-17-2016 10:37 AM
09-17-2016 02:29 PM - edited 09-17-2016 02:29 PM
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.