The SAS Output Delivery System and reporting techniques

ods tagsets.msoffice2k and image in cell of proc report

Reply
Regular Contributor
Regular Contributor
Posts: 156

ods tagsets.msoffice2k and image in cell of proc report

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
SAS Super FREQ
Posts: 8,864

Re: ods tagsets.msoffice2k and image in cell of proc report

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
Regular Contributor
Regular Contributor
Posts: 156

Re: ods tagsets.msoffice2k and image in cell of proc report

Posted in reply to Cynthia_sas
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
SAS Super FREQ
Posts: 8,864

Re: ods tagsets.msoffice2k and image in cell of proc report

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
Regular Contributor
Regular Contributor
Posts: 156

Re: ods tagsets.msoffice2k and image in cell of proc report

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
Ask a Question
Discussion stats
  • 4 replies
  • 233 views
  • 0 likes
  • 2 in conversation