| Date: | Wed, 30 Apr 2003 11:47:32 -0700 |
| Reply-To: | "Huang, Ya" <yhuang@AMYLIN.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | "Huang, Ya" <yhuang@AMYLIN.COM> |
| Subject: | Re: PROC REPORT - Spanning headers |
|
| Content-Type: | text/plain; charset="iso-8859-1" |
Tom,
My first reaction is to make 'name sex age' as another group
of spanned column and leave the header blank inside the quotation mark:
column (" " name sex age) ("spanned column 1" name2 sex2 age2)
("spanned column 2" name3 sex3 age3) name4 height weight;
Somehow ODS won't allow a blanked header for the spanned
column, which caused an error message:
ERROR: Read Access Violation In Task ( REPORT ]
Exception occurred at (663ED757)
Task Traceback
Now it leaves me only one choice, i.e. to use some nonprintable
letter to fool ODS, so that it won't consider it a blanked
header, yet it won't show up in the final table. I usually
use 'A0'x, which is assigned to a macro var called null in precedent
data step:
data test;
set sashelp.class;
length name2 name3 name4 $ 8;
length sex2 sex3 sex4 $ 1;
name2 = name; sex2 = sex; age2 = age;
name3 = name; sex3 = sex; age3 = age;
name4 = name;
call symput('null','A0'x); /* create a null macro var */
run;
ods html file="c:\temp\junk.html";
proc report data=test nowd style(header)=[background=white];
column ("&null" name sex age) ("spanned column 1" name2 sex2 age2)
("spanned column 2" name3 sex3 age3) name4 height weight;
define name /'name' style=[background=grey];
....
It seems to get what you want now.
Kind regards,
Ya Huang
-----Original Message-----
From: Burgan, Thomas [mailto:TMB4F@hscmail.mcc.virginia.edu]
Sent: Wednesday, April 30, 2003 11:27 AM
To: Huang, Ya
Subject: RE: PROC REPORT - Spanning headers
Ya,
Thank you for your response. I have expanded the number of variables in the test dataset to be more comparable to the number of columns I am actually working with. Use the following code:
data test;
set sashelp.class;
length name2 name3 name4 $ 8;
length sex2 sex3 sex4 $ 1;
name2 = name; sex2 = sex; age2 = age;
name3 = name; sex3 = sex; age3 = age;
name4 = name;
ods html file="c:\temp\junk.html";
proc report data=test nowd style(header)=[background=white];
column name sex age ("spanned column 1" name2 sex2 age2) ("spanned column 2" name3 sex3 age3) name4 height weight;
define name /'name' style=[background=grey];
define sex / 'sex' style=[background=white];
define age / 'age' style=[background=grey];
define name2 /'name2' style=[background=white];
define sex2 / 'sex2' style=[background=white];
define age2 / 'age2' style=[background=white];
define name3 /'name3' style=[background=grey];
define sex3 / 'sex3' style=[background=grey];
define age3 / 'age3' style=[background=grey];
define name4 /'name4' style=[background=white];
define height / 'height' style=[background=grey];
define weight / 'weight' style=[background=white];
run;
ods html close;
You will notice that the color of the spanned-row area over the first three columns is grey. I am assuming it is grey because the background color of the last column in that group ("age") is grey. I would like it to be white like the rest of this row's "cells".
Any ideas?
Thanks!
Tom
-----Original Message-----
From: Huang, Ya [mailto:yhuang@amylin.com]
Sent: Wednesday, April 30, 2003 12:06 PM
To: Tom Burgan
Subject: RE: PROC REPORT - Spanning headers
Tom,
I'm having hard time understand your request described in the last
paragraph. Dose the following code generate the table any close to
your expected? Can you tell me what need to be changed in terms of
colors, so that I might try it again?
ods html file="c:\temp\junk.html";
proc report data=sashelp.class nowd style(header)=[background=white];
column name ("spanned column" sex age) weight;
define name /' ' style=[background=white];
define sex / style=[background=grey];
define age / style=[background=grey];
define weight /' ' style=[background=white];
run;
ods html close;
Kind regards,
Ya
-----Original Message-----
From: Tom Burgan [mailto:tmb4f@VIRGINIA.EDU]
Sent: Tuesday, April 29, 2003 1:46 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: PROC REPORT - Spanning headers
I have a report in which I group some of the columns with spanning
headers (defined in the COLUMNS statement). To improve readability, I
also vary the background colors of each column or group of columns
between white or grey (ex. DEFINE LNAME/STYLE={BACKGROUND=#D3D3D3}
'Last/Name'). So, the first row of my generated table shows blank
"cells" over a column or group of columns where I didn't define a
spanning header, and "cells" with spanning headers over groups of
columns where this option was used.
The problem I am having concerns the background color of these
"cells". I would like this first "spanned header" row to have a white
background across all columns, whether or not the column has a white
background or not.
The spanned header cells have a white background, independent of the
background color of the spanned group of columns. The background
color of the blank cells, however, is always the same color as the
background of the LAST column in this "unspanned" column or group of
columns (inheritance?).
Is there a style element for this additional header row created when
defining spanning headers in a PROC REPORT procedure?
Thank you.
Tom
|