BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I am using the following to output the results of a stored process to Excel.

data _null_;
rc = stpsrv_header('Content-type','application/vnd.ms-excel;');
rc = stpsrv_header('Content-disposition',"attachment; filename=name.xls");
run;
%let _odsdest=tagsets.msoffice2k;
%let _odsstyle=sasweb;

My problem is that the output create a Traffic light report, but if a negative $ value is returned, the font is red. However, the background for that cell will also be red because of the traffic light rules. I need to be able to reset the format in Excel to make sure that the font color is black.

What do I need to do to send the desired font color to Excel?

Thanks for any clues.
KeithS
2 REPLIES 2
Cynthia_sas
SAS Super FREQ
Are you using PROC PRINT, PROC REPORT or PROC TABULATE for setting your traffic lighting?? User-defined format?? or CALL DEFINE??

The reason I ask is that, when I run this code in SAS (not as a stored process, just as a regular step), I get a red background color and black font in Excel.

You may want to contact Tech Support and have them look over your entire program and suggest how you can change your code to achieve what you want. It seems odd to me that your traffic lighting would make both the foreground and background color red.

cynthia

My foreground color is black when I submit this code:[pre]

data class;
set sashelp.class;
if age gt 14 then age = age * -1;
run;

proc format;
value agebk 1-high = 'white'
low-0 = 'red';
run;

ods msoffice2k file='trafic.xls' style=sasweb;
proc report data=class nowd;
column name age height;
define name /order;
define age /display style(column)={background=agebk.};
define height /display;
run;
ods _all_ close;[/pre]
deleted_user
Not applicable
Thank you for the response.

My code is producing HTML with a DATA _NULL_. The background in the is set based on values in the data. The Stored Process is run via the Information Delivery Portal.

Once again, thanks for the response and I will check with SAS support.

KeithS

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