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

How does one generate a graph and embed it into an Excel document?

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
Diamond | Level 26

Hi:

  There is no "ODS EXCEL" destination. So I'm not exactly sure what you mean. There are only a few ways to get data/reports from SAS to Excel:

1) Export methods  (dataset --> workbook/worksheet)

    a) PROC EXPORT (no graph support)

    b) LIBNAME EXCEL engine (no graph support)

2) ODS methods (procedure output --> workbook/worksheet)

    a) ODS CSV (comma separated values) (no graph support)

    b) HTML-based destinations: ODS MSOFFICE2K, ODS MSOFFICE2K_X, ODS TAGSETS.TABLEEDITOR

    c) XML-based destinations: ODS TAGSETS.EXCELXP (no graph support)

  As you can see, as far as graph/image support goes, the only ODS destinations that support the inclusion of graph images are the HTML-based destinations, primarily the ones that are designed to work with Microsoft Office (Word, Excel). That is because the HTML that is created by ODS contains a standard HTML <IMG> tag that Excel knows how to open and include in the worksheet. To a certain extent, the file that you create does not contain "embedded" graphs. There are a lot of postings in the forum on using HTML-based methods to create files that Excel can open and render. And, there are a lot of Tech Support notes on using ODS to create files that Excel can open. Using image/graph files is one of the strengths of using using the HTML-based methods.

cynthia

View solution in original post

3 REPLIES 3
Cynthia_sas
Diamond | Level 26

Hi:

  There is no "ODS EXCEL" destination. So I'm not exactly sure what you mean. There are only a few ways to get data/reports from SAS to Excel:

1) Export methods  (dataset --> workbook/worksheet)

    a) PROC EXPORT (no graph support)

    b) LIBNAME EXCEL engine (no graph support)

2) ODS methods (procedure output --> workbook/worksheet)

    a) ODS CSV (comma separated values) (no graph support)

    b) HTML-based destinations: ODS MSOFFICE2K, ODS MSOFFICE2K_X, ODS TAGSETS.TABLEEDITOR

    c) XML-based destinations: ODS TAGSETS.EXCELXP (no graph support)

  As you can see, as far as graph/image support goes, the only ODS destinations that support the inclusion of graph images are the HTML-based destinations, primarily the ones that are designed to work with Microsoft Office (Word, Excel). That is because the HTML that is created by ODS contains a standard HTML <IMG> tag that Excel knows how to open and include in the worksheet. To a certain extent, the file that you create does not contain "embedded" graphs. There are a lot of postings in the forum on using HTML-based methods to create files that Excel can open and render. And, there are a lot of Tech Support notes on using ODS to create files that Excel can open. Using image/graph files is one of the strengths of using using the HTML-based methods.

cynthia

TonyHuy
Calcite | Level 5

Great answer Cynthia. THanks!!!

So if I have a SAS server that does include an Web server running on it, and I want to generate a report and send it off to someone, there's no real way to include this with a graph, correct?  (with HTML or XML)

I know I can do it with PDF.

jakarman
Barite | Level 11

Experimental underway 9.4:

UNDERSTANDING THE MICROSOFT OFFICE OPEN XML FORMAT

ods excel file="temp.xlsx";

http://support.sas.com/resources/papers/proceedings14/SAS177-2014.pdf

---->-- ja karman --<-----

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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