The SAS Output Delivery System and reporting techniques

Is it possible to include PROC GPLOT output in XML file?

Accepted Solution Solved
Reply
Trusted Advisor
Posts: 1,294
Accepted Solution

Is it possible to include PROC GPLOT output in XML file?

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!


Accepted Solutions
Solution
‎05-21-2015 10:54 AM
SAS Super FREQ
Posts: 8,646

Re: Is it possible to include PROC GPLOT output in XML file?

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


All Replies
Esteemed Advisor
Esteemed Advisor
Posts: 6,726

Re: Is it possible to include PROC GPLOT output in XML file?

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.

Solution
‎05-21-2015 10:54 AM
SAS Super FREQ
Posts: 8,646

Re: Is it possible to include PROC GPLOT output in XML file?

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

Trusted Advisor
Posts: 1,294

Re: Is it possible to include PROC GPLOT output in XML file?

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

Post a Question
Discussion Stats
  • 3 replies
  • 572 views
  • 0 likes
  • 3 in conversation