The SAS Output Delivery System and reporting techniques

Underlining Summary lines in Proc Report

Reply
N/A
Posts: 0

Underlining Summary lines in Proc Report

How can I underline my summary line at each break?

SAS 9.1.3 Excel XP tagset (SAS 9.1.3, v1.28, 08/29/05)
(processing mainframe to PC)

ODS TAGSETS.EXCELXP FILE=NETINT TRANTAB=ASCII
OPTIONS(EMBEDDED_TITLES='YES'
SHEET_NAME='WEEKLY' FROZEN_HEADERS='3');
RUN;
PROC REPORT NOWD DATA=W_W
STYLE(HEADER)={FOREGROUND=BLACK FONT_SIZE=3 JUST=C}
STYLE(COLUMN)={FOREGROUND=BLACK BACKGROUND=WHITE}
STYLE(SUMMARY)={FOREGROUND=BLACK BACKGROUND=SILVER};
TITLE "NH WEEKLY METRO";
COLUMN MARKET NAME REPORTING COUNTY NITHHWK1-NITHHWK4;
DEFINE MARKET / GROUP RIGHT;
DEFINE NAME / GROUP;
DEFINE REPORTING / GROUP;
DEFINE COUNTY / ORDER CENTER;
DEFINE NITHHWK1 / SUM '1 NIT';
DEFINE NITHHWK2 / SUM '2 NIT';
DEFINE NITHHWK3 / SUM '3 NIT';
DEFINE NITHHWK4 / SUM '4 NIT';
BREAK AFTER MARKET/ SUMMARIZE SUPPRESS SKIP
STYLE(SUMMARY)={FOREGROUND=BLACK};
RUN;
SAS Employee
Posts: 95

Re: Underlining Summary lines in Proc Report

There is a style attribute called text_decoration that will do what you want.
The value should be set to underline.

The only problem is that the excel tagset does not currently support text_decoration. I will look into adding it and post back with what I find.
SAS Employee
Posts: 95

Re: Underlining Summary lines in Proc Report

Here is an example of how it works with the tagset changes I made this morning. The example sashelp.class report is silly because I didn't order it, but it does show a lot of underlined sumary lines.

I don't see a way of attaching anything here. Send me direct email at
ODS@sas.com and I'll send you the new tagset that you'll need for this
to work.

You could avoid the style definition and do all style over-rides but this
will create more compact and efficient Excel XML.

Eric

proc template;

define style styles.mystyle;
parent = styles.default;

style myheader from header /
foreground=black
font_size=3
just=c
;
style whiteheader from header /
foreground=black
background=white
;
style silverheader from whiteheader /
background=silver
;

style summary /
foreground=BLACK
text_decoration=underline
;
end;

run;


ODS TAGSETS.EXCELXP style=mystyle FILE="test.xls"
OPTIONS(EMBEDDED_TITLES='YES'
SHEET_NAME='WEEKLY' FROZEN_HEADERS='3');
RUN;

/*
PROC REPORT NOWD DATA=W_W
STYLE(HEADER)=myheader
STYLE(COLUMN)=whiteheader
STYLE(SUMMARY)=silverheader;
TITLE "NH WEEKLY METRO";
COLUMN MARKET NAME REPORTING COUNTY NITHHWK1-NITHHWK4;
DEFINE MARKET / GROUP RIGHT;
DEFINE NAME / GROUP;
DEFINE REPORTING / GROUP;
DEFINE COUNTY / ORDER CENTER;
DEFINE NITHHWK1 / SUM '1 NIT';
DEFINE NITHHWK2 / SUM '2 NIT';
DEFINE NITHHWK3 / SUM '3 NIT';
DEFINE NITHHWK4 / SUM '4 NIT';
BREAK AFTER MARKET/ SUMMARIZE SUPPRESS SKIP
STYLE(SUMMARY)=summary;
RUN;
*/

PROC REPORT NOWD DATA=sashelp.class
STYLE(HEADER)=myheader
STYLE(COLUMN)=whiteheader
STYLE(SUMMARY)=silverheader;
TITLE "NH WEEKLY METRO";
COLUMN NAME sex age weight;
DEFINE sex / GROUP RIGHT;
DEFINE NAME / GROUP;
BREAK AFTER sex/ SUMMARIZE SUPPRESS SKIP
STYLE(SUMMARY)=summary;
RUN;


ods _all_ close;
Ask a Question
Discussion stats
  • 2 replies
  • 139 views
  • 0 likes
  • 2 in conversation