BookmarkSubscribeRSS Feed
gzr2mz39
Quartz | Level 8

I would like to create a yellow cell below my proc report output.

I'm using ods tagsets.excelxp to create the excel file (which is initially outputted as an xml file).

If, for example, my proc report table ends at row 10 I would like to add a cell with a yellow background in row 12 column A.
Any ideas?

2 REPLIES 2
ballardw
Super User

Untested but my first thought would be an ODS tagsets.excelxp Text= with a style to provide a yellow background to text. You probably would need to provide a text literal to get it to display. You don't say if you want text or not. If not a NULL charcter (ASCII 255) might work.

From some experience with other ODS output destinations this might appear on the third row after your table output as the ODS templates seem to have some element that isn't exposed to our control that outputs 2 blank lines regardless of destination.

Cynthia_sas
SAS Super FREQ

Hi:

  I can't find it now, but I remember something about ODS TEXT= and TAGSETS.EXCELXP. I am not sure that it works in all circumstances. It might be something to test out. For example, in the code below, run in SAS 9.3, and opened in Excel 2010, the output from ODS TEXT= does not appear in my file, when the XML file is opened in Excel. I used TAGSETS.EXCELXP version  v1.122 and also tested in version 1.127 -- and ODS TEXT= output did not appear in either output file.

  In the output created below, however, note that any text written with a LINE statement spans the whole table. And, if ODS TEXT did work, then it, too would span the entire table -- the text, like the LINE output would not settle just in COLUMN A.

    SAS does not have the concept of "column A" or "row 10" -- TAGSETS.EXCELXP makes an XML table from the data you send to PROC REPORT. PROC REPORT makes the report. If you have a BREAK or RBREAK statement, then summary lines get added. The summary information is an entire "row"...of summarized columns. As I show, you can "touch" one of the cells in the summary row with a COMPUTE block, but you only get 1 report row for each BREAK or RBREAK statement. And, if you use a LINE statement, then your "LINE area" spans the whole table, not just one cell.

cynthia

ODS TAGSETS.EXCELXP file='c:\temp\makeyellow.xml' style=sasweb

    options(doc='Help');

title;

ods listing close;

proc report data=sashelp.class nowd;

  column name age sex height weight;

  rbreak after / summarize;

  compute after /style={background=pink just=l};

    call define('name','style','style={background=yellow}');

    line 'This is a line';

  endcomp;

run;

ods text='some text';

ODS TAGSETS.EXCELXP CLOSE;


make_yellow_cell_xp.png

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