Hi there,
I want to insert multiple graph file into a single HTML file.
I am using GTL(PROC Template and SGRENDER procedure) to generate graphs to generate graph for several categories(page break). I get output in HTML but I also get SGRENDER1.png,.... SGRENDERn.png.
But how do I get a single HTML file where the image files(png) embedded into a single file.
Can we do this with PROC GREPLAY or Is there any other way?
Thanks in Advance.
Surendar.
With SAS9.4 you also have the possibility to have the images inline in the HTML source, so there is just the HTML output. You will use the HTML5 destination for this, see sample below.
Since you already use GTL and Proc SGRENDER you can combine your individual graphs into one statgraph defintion using nested layouts. Please be aware that all the data for the individual graphs must come from the same data set. See a sample below using SASHELP.CARS. Maybe SGPANEL might be another option. If you show us what it should look like will help.
Close the ODS LISTING destination.
You could use ODS LAYOUT to combine multiple graphs in a grid-style layout within a single HTML file. See the ODS LAYOUT documentation for more examples; I have a simple example within this post:
Implement BY processing for your entire SAS program - The SAS Dummy
It's also a good idea to name your graph files when possible, using the IMAGENAME option on the ODS GRAPHICS statement. Use RESET=INDEX to provide consistent numbering when you rerun your program to update the results.
More here: SAS(R) 9.4 Output Delivery System: User's Guide, Second Edition
Chris
Hi,
Assume this is the same question from:
https://communities.sas.com/thread/52976
Was my last suggestion there not what you were looking for? Do you literally want to embed an image in the html file using html5 (as in my first response)? Still confused...
--Q.
Hi.
Yes I want all the image files to be embeded into a single Html file like how we generate for RTF or PDF..
Dear All,
Thanks For quick responses!!!
I forgot to add one point that my template will be executed only once but I would Call the SGRENDER Procedure multiple times.
Proc template;
define statgraph pag_brk;
.......
quit;
DO i=1 for each categories;
data temp;
set source;
if variable=%scan(category,&i,/);
run;
proc sgrender data=temp template=pag_brk;
run;
end do;
I get output as below, One single html file which refers Two png files.Incase if we delete this file then you cannot view these images in html file(since unlike rtf or pdf the html refers the path of the image file)
So I would like to have a Single Html file where these two files embeded in to it.
Many Thanks....
Surendar.
Hi All.
I have one more help regarding the template creation. could you please help.
With SAS9.4 you also have the possibility to have the images inline in the HTML source, so there is just the HTML output. You will use the HTML5 destination for this, see sample below.
Hi,
Yeah, I explored SAS 9.4 features that it has HTML5 destination which fulfil my need. Since I use 9.3v Is there any other possible way?
Thanks..
I am not aware of anything in SAS9.3
how about creating a PDF instead
How is the HTML made available to the user?
I need HTML output(i have already generated RTF and PDF for this output)
Thats fine.
Thanks for your help..
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.