BookmarkSubscribeRSS Feed
OS2Rules
Obsidian | Level 7
Hi All:

I'm relatively new to XML and I have a request to add an image to a spreadsheet that I create using the ExcelXP tagset. It will just be a small banner image in the top corner of the page.

I have tried to find some XML code examples on how this is done, but I can't seem to find any. I would like to place an external link in the spreadsheet that points to an image (.jpg, .bmp) that is in an external library, rather than having the image imbedded in the spreadsheet.

Chevell (SAS) has informed me that the tagset can't do this at this time, but there must be some trick, such as coding the tags in a TITLE statement that would work.

Any help/examples would be appreciated.
1 REPLY 1
Cynthia_sas
Diamond | Level 26
Hi!
Chevell is right. You can prove it by trying this experiment:
1) open Excel
2) type something in a few cells
3) go to View --> Header and Footers
4) Insert a picture into the Header of the file
5) Save the spreadsheet to XML format

You will see the following message (from Excel):[pre]
The following features from your workbook will not be saved in the XML Spreadsheet
--Page header or footer image
Do you want to continue saving as an XML Spreadsheet?
[/pre]
Coding the images in a TITLE statement works for HTML, RTF and PDF because those destinations support the insertion of images in one form or the other. Microsoft does NOT -- at least for XML at this time. So IF you create an ExcelXP file with ODS, I think your only choice to get an image into the header of the document is to have an Excel Macro or VB script open the xml file, insert the image and then resave as an XLS file.

(Or wait until Microsoft changes the XML spec to accept images.)
cynthia

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 1 reply
  • 3056 views
  • 0 likes
  • 2 in conversation