BookmarkSubscribeRSS Feed
christyh
Calcite | Level 5
Hi there,

I'm currently creating a new style using proc template (and Enterprise Guide). I want to have each row of data alternate colours (grey/white) and I've found this piece of code:
ods tagsets.tableeditor body="temp.htm"
options(banner_color_even="lightblue"
banner_color_odd="pink");

This doesn't seem to work in EG as I get this message: WARNING: Tagset TAGSETS.TABLEEDITOR not found;

I'm new to all this styles/tagset stuff so maybe I'm missing something basic. Any help would be appreciated.

Thanks,
Christy
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:
TAGSETS.TABLEEDITOR is not delivered with SAS 9.1.3, by default, since it was developed AFTER 9.1.3 was released. I'm not sure whether it is delivered with SAS 9.2 or not. At any rate, you can download the tagset template for TAGSETS.TABLEEDITOR from this site,
http://support.sas.com/rnd/base/ods/odsmarkup/tableeditor/index.html

Then, run the code, which will install the template in your SASUSER.TEMPLAT item store. Then you can use the newly installed tagset as shown in the above web site and in the various papers that show how to use it.

It is also possible to get alternate colors with several other procedures. It is easier in SAS 9.2 than in SAS 9.1.3, but for example, this code will alternate colors using PROC REPORT and using several ODS destination:
[pre]
ods tagsets.excelxp file='rep_graybar.xml' style=sasweb;
ods html file='rep_graybar.html' style=sasweb;
ods pdf file='rep_graybar.pdf' ;
ods rtf file='rep_graybar.rtf';
proc report data=sashelp.class nowd
style(summary)={font_weight=bold};
title 'Highlight Every Other Row';
column name age height weight;
define name / order;
define age / display;
define height / display;
define weight / display;
compute name;
** if tempvar is evenly divisible by 2, it is even;
** so highlight it with gray for the whole row;
tempvar + 1;
if mod(tempvar,2) eq 0 then
call define(_ROW_,'STYLE','style={background=#eeeeee}');
endcomp;
run;
ods _all_ close;
[/pre]

If you want some of the other functionality of the TABLEEDITOR tagset, then you will have to download and install the template definition. If all you want to do is get alternating colors, you can achieve that with other methods.

cynthia

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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