BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
PaigeMiller
Diamond | Level 26

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:

  1. Include the graphic in the XML file (similar to the appearance when you paste a graphic into an Excel file)
  2. Include a link in the XML file to the graphics which are written to an .html file

If it is possible, would you please be kind enough to provide an example or link to documentation? Thanks!

--
Paige Miller
1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

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

View solution in original post

3 REPLIES 3
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

Cynthia_sas
SAS Super FREQ

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

PaigeMiller
Diamond | Level 26

Thank you Cynthia, this seems like it will work well for me.

--
Paige Miller

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1535 views
  • 0 likes
  • 3 in conversation