BookmarkSubscribeRSS Feed
Eva
Quartz | Level 8 Eva
Quartz | Level 8
Dear all,

I have a forecast report which works fine in ODS HTML and ODS PDF. I'm now trying to display an image in the xls output.

For the Excel Output I use
ods tagsets.msoffice2k STYLE=sasdocprinter file=_webout;

For the report I use the proc report procedure.

The forecast report has a column at the right with an image (arrow up or down depending on the data on the left in the same row). This works in HTML like this:

compute kz_tzqu;

if kz_jahr_alt - kz_kw_alt > 0 then
call define (_col_,"style", "Style=&v_url_red.");

if kz_jahr_alt - kz_kw_alt = 0 then
call define (_col_,"style", "Style=&v_url_blue.");

if kz_jahr_alt - kz_kw_alt < 0 then
call define (_col_,"style", "Style=&v_url_green.");

end;

endcomp;

Where:

%let v_url_red = [preimage='http://myserver/images/arrow_red.gif'];
%let v_url_blue = [preimage='http://myserver/images/arrow_blue.gif'];
%let v_url_green = [preimage='http://myserver/images/arrow_green.gif'];


Could you tell me how I can do this in the ods tagsets.msoffice2k?

Best regards,
Eva
4 REPLIES 4
Cynthia_sas
SAS Super FREQ
Hi:
In my experience, Excel is not very graceful with multiple images in cells. Sometimes, the image will be awkwardly placed, sometimes the image such as a logo will overlay part of a title string.

In your example, I'm not sure that Excel will use a URL to go get an image. That referencing method works for HTML because of the request/response nature of the HTTP protocol. When the browser determines that it needs the image off the server, the browser sends a request for the web server to deliver the image. I'm not sure that Excel will operate that way.

With ODS PDF and ODS RTF, for example, you normally do not use an HTTP URL to point to images -- you have to use a local or c:\drive location. The reason for this is that the image for RTF and PDF is the location where the image lives when the file is CREATED. I think that Excel is OK with a reference to an image location -- but I'm not sure an HTTP location will be OK. You might want to check with Tech Support on this one.

cynthia
Eva
Quartz | Level 8 Eva
Quartz | Level 8
Dear Cynthia,

for ODS PDF I use


%let v_url_red_pdf = [preimage='/project/src/arrow_red.gif'];
%let v_url_blue_pdf = [preimage='/project/src/arrow_blue.gif'];
%let v_url_green_pdf = [preimage='/project/src/arrow_green.gif'];


which works fine. But this does not work for the ods tagset excel.

Eva
Cynthia_sas
SAS Super FREQ
This is really one where you need to work with Tech Support, I think. I don't think a URL attribute for the image will work, but if the physical location reference of the image doesn't work, I'm not sure what will.

cynthia
Eva
Quartz | Level 8 Eva
Quartz | Level 8
Dear all,

I gave the problem to SAS tech support and the answer was: this does not work for ods tagset excel. The suggestion was to highlight the cell in green red or yellow and write a fitting text into it. I think that's a good alternative.

Best regards
Eva

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 4 replies
  • 848 views
  • 0 likes
  • 2 in conversation