I have some SAS Graphics created from PROC GPLOT. I also have created an .xml containing a PROC REPORT output via ODS TAGSETS.EXCELXP. Is it possible to do either:
If it is possible, would you please be kind enough to provide an example or link to documentation? Thanks!
Hi:
By Microsoft design, TAGSETS.EXCELXP form of Spreadsheet Markup Language XML -- so if your question is whether you can GPLOT output specifically into that output from ODS, the answer is NO.
If you read this Blog post by Chris Hemedinger, you will see that the NEW destination (ODS EXCEL) will support graphics. http://blogs.sas.com/content/sasdummy/2014/08/29/experimenting-with-ods-excel-to-create-spreadsheets... Code is in the blog.
cynthia
Well, at the risk of being proved wrong, I don't think it is possible. The reason is that tagsets.excelxp doesn't create an Excel file. It only creates a marked up text file which Excel then interprets. Now it maybe with the 9.4 libname to Excel they have added functionality, can't comment on this as have not used it.
In the ZIP file (which is what xlsx is), the picture is stored in its internal structure. There are additional XML files create which link this to the work sheet and how to display it. So if you know how to manually build XLSX structure documents, then its possible to add in your pictures and generate the required XML linkage.
I would think the effort is far too much though. IMO I wouldn't use Excel for anything. But if you are stuck and have to do this, then you could also consider exporting all your component parts to a folder:
data.csv
graph1.png
grph2.png
etc.
Then have an empty Excel workbook which contains your formatted output requirement file. Then, either in that file or another (if you don't want your output file macro enabled), have a VBA macro which opens the files from that directory and pastes the information into your template output file. Hope this is clear. So instead of pushing your output from SAS, have Excel drag it in.
Hi:
By Microsoft design, TAGSETS.EXCELXP form of Spreadsheet Markup Language XML -- so if your question is whether you can GPLOT output specifically into that output from ODS, the answer is NO.
If you read this Blog post by Chris Hemedinger, you will see that the NEW destination (ODS EXCEL) will support graphics. http://blogs.sas.com/content/sasdummy/2014/08/29/experimenting-with-ods-excel-to-create-spreadsheets... Code is in the blog.
cynthia
Thank you Cynthia, this seems like it will work well for me.
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.