The SAS Output Delivery System and reporting techniques

expand color across all columns

Reply
Contributor
Posts: 39

expand color across all columns

I would like the color for the ALL keyword to extend across all of the columns.

I've checked some documentation and it would appear that my syntax is correct.
However, it is only highlighting the word "SubTotal"., and not expanding across.

Can anyone see where my syntax is wrong? Or missing something?


proc tabulate data=&period.level missing;
class product1 product_raw;
class &periodvar. / descending;
var &balvar. ;
tables
(product1=''*(product_raw=' ' ALL='SubTotal') ALL='All Products')*[style=],
(&periodvar.="Calendar &period.")*
(&balvar.=''*sum ='Outstanding Avg. $MM' *f=mmfmt. *[style=[tagattr='Format:$###,###,###,###.00;[Red][<0]$-###,###,###,###.00']])
/ box="Product" rtspace=25 row=float;
KEYWORD ALL / s=[font_weight=bold font_face=times font_size=1 background=liypk];
Contributor
Posts: 39

Re: expand color across all columns

Posted in reply to steve_citi
This line did not get in the original posting:


/ box="Product" rtspace=25 row=float;
KEYWORD ALL / s=[font_weight=bold font_face=times font_size=1 background=liypk];
SAS Super FREQ
Posts: 8,868

Re: expand color across all columns

Posted in reply to steve_citi
Hi:
Sometimes when you use < or > in your code, the forum posting mechanism sees those characters as HTML delimiting tags and some of your post gets truncated or scrambled. if you use &lt; and &gt; instead of < and > when you post code, your code won't get truncated.

At any rate, helpful to know would be the destination of interest and which ALL you want to have impacted by your style -- the ALL that's labelled 'SubTotal' or the ALL that's labelled 'All Products'.

The simplified code below may help you figure out what's going wrong. I prefer to use { and } instead of [ and ] because they are easier to distinguish in statements that also have parentheses.

Also, I took out the RTSPACE option, since it has no impact on destinations other than the LISTING destination and your use of STYLE overrides implies that you are using ODS destinations.

cynthia
[pre]
ods tagsets.excelxp file='c:\temp\parent_style.xls' style=sasweb;
ods html file='c:\temp\parent_style.html' style=sasweb;

proc tabulate data=sashelp.prdsale missing;
title '1) Style=<parent>';
class region division;
class product / descending;
var actual ;
tables
(region=''*(division=' ' ALL='SubTotal'*{style=<parent>})) ALL='All Products'*{style=<parent>},
(product="Product")*(actual=''*sum ='Actual')
/ box="Box Text" row=float ;
KEYWORD ALL /
s=[font_weight=bold font_face=Times font_size=1 background=liypk];
run;

ods _all_ close;
[/pre]
Contributor
Posts: 39

Re: expand color across all columns

Posted in reply to steve_citi
Hi Cynthia,

Thanks for your reply. The ALL that I am interested in is the "SubTotal" ALL.

I think my code and yours are logically equivalent.

I have the *[style=] in the same place as your code, after the definition of the first dimension.

Is there something else missing? It will only highlight the word "SubTotal".
SAS Super FREQ
Posts: 8,868

Re: expand color across all columns

Posted in reply to steve_citi
Hi,
Have you actually run my code???? My whole row gets the color changed. In fact, there are differences in the placement of parentheses in our two TABLE statements in in the placement of the style=<parent> syntax.
[pre]
My TABLE statement:

tables
(region=''*(division=' ' ALL='SubTotal'*{style=<parent>})) ALL='All Products'*{style=<parent>},
(product="Product")*(actual=''*sum ='Actual')
/ box="Box Text" row=float ;
KEYWORD ALL /
s=[font_weight=bold font_face=Times font_size=1 background=liypk];

Your TABLE statement:

tables
(product1=''*(product_raw=' ' ALL='SubTotal') ALL='All Products')*[style=<parent>],
(&periodvar.="Calendar &period.")*
(&balvar.=''*sum ='Outstanding Avg. $MM' *f=mmfmt. *[style=[tagattr='Format:$###,###,###,###.00;[Red][<0]]]]

/ box="Product" rtspace=25 row=float;
KEYWORD ALL / s=[font_weight=bold font_face=times font_size=1 background=liypk];
[/pre]

So, I would recommend starting with MY code, making sure that the highlighting is being done correctly, and then changing your code accordingly.

cynthia
Contributor
Posts: 39

Re: expand color across all columns

Posted in reply to steve_citi
Cynthia,

I executed your code and it does produce the desired results.

I have modified my code as well to match yours.

However, for some reason it is still not working.

proc tabulate data=&period.level missing;
class product1 product_raw;
class &periodvar. descending;
var &balvar. ;
tables (product1=' ' *(product_raw=' ' ALL='SubTotal'*{style=}))
ALL='All Products'*{style=},
(&periodvar.="Calendar &period.")*
(&balvar.=''*sum ='Outstanding Avg. $MM' *f=mmfmt.
*[style=[tagattr='Format:$###,###,###,###.00;[Red][<0]$-
###,###,###,###.00']])
/ box="Product" rtspace=25 row=float;
KEYWORD ALL / s=[font_weight=bold font_face=times font_size=1 background=liypk];
SAS Super FREQ
Posts: 8,868

Re: expand color across all columns

Posted in reply to steve_citi
Hi:
Well, the one difference is that you have a *[style=[...]] in your COLUMN dimension and I do not have that in my TABLE statement. I'd suggest either:
1) taking out the style= override in the COL dimension or
2) putting
[pre]/ style_precedence=row ;[/pre]

in your TABLE statement options.

The default order of precedence is that the column dimension style and column dimension format "win" over the row dim style and row dim format.

cynthia
Contributor
Posts: 39

Re: expand color across all columns

Posted in reply to Cynthia_sas
Cynthia,

Sorry for being so dense.....but where do you see me using a parent for my column dimension?

I have 2 style= references.......same as you.
SAS Super FREQ
Posts: 8,868

Re: expand color across all columns

Posted in reply to steve_citi
The STYLE for TAGATTR in the COLUMN dimension might be overriding the STYLE=<PARENT> in the ROW dimension.

Even though you do not explicitly have STYLE=<PARENT> in the COL dimension, you have -some- style attribute override and PROC TABULATE is very touchy about deciding which style attribute to use. If you remove the TAGATTR override and it works, then you know why. If you use style_precedence=row, you could very well get the color you want without the TAGATTR being used. But first, if the color is more important, you need to get that working.

cynthia
Ask a Question
Discussion stats
  • 8 replies
  • 295 views
  • 0 likes
  • 2 in conversation