The SAS Output Delivery System and reporting techniques

ExcelXP Tagset Options + Style Options in PROC Tabulate

Reply
N/A
Posts: 0

ExcelXP Tagset Options + Style Options in PROC Tabulate

Hello,

I have an Excel spreadsheet being generated through ExcelXP and I am using a tagattr option within the body of the table (percent formatting). Additionally, I would like to add a background color for one particular variable but not for the other (I'm using a custom format, as can be seen in the classlev statements). Can I use both style options together, or will the tagattr not allow me to add anything else? The tabulate code:

proc tabulate data = stuff;
class level actname eth frl / style=classlev2;
classlev level / style=classlev;
classlev eth frl / style=classlev2;
table (level = ' ' )*(actname = ' ' all='Subtotal'),
eth='Ethnicity'*(n='#'*f=5. pctn='%'*f=pctfmt6.*[style=[tagattr='Format: 0.0%']])
frl='FRL Status'*(n='#'*f=5. pctn='%'*f=pctfmt6.*[style=[tagattr='Format: 0.0%']])
/ row=float misstext='-' indent=0;
run;

In this case, I would like to add a background shading to the Ethnicity data to increase readability.

Possible or impossible?

Thanks!
SAS Employee
Posts: 174

Re: ExcelXP Tagset Options + Style Options in PROC Tabulate

Elayne,

Just do:

[pre]
eth='Ethnicity'*(n='#'*f=5. pctn='%'*f=pctfmt6.*[style=[tagattr='Format: 0.0%' background=red]])
[/pre]

substituting the desired background color for red.

-- David Kelley, SAS
N/A
Posts: 0

Re: ExcelXP Tagset Options + Style Options in PROC Tabulate

Wow, I can't believe I asked that...I think that's what happens after a morning of figuring out how to override the alignment options in ExcelXP until you realize there is no alignment option and you have to go through the Proc Template route. The glaringly obvious solutions have eluded me, apparently!

Actually, that brings another question: my titles are centered ('Ethnicity' and the corresponding values) and my data are centered, both through template options. The '#' and '%' signs are not, however. I'm mostly concerned about the '%' sign, though, since that tagattr option is already in there. What kind of style element could I put in my template to enable me to center the # and % column headers?

Thanks.
SAS Employee
Posts: 174

Re: ExcelXP Tagset Options + Style Options in PROC Tabulate

Does this work for you?
[pre]
eth='Ethnicity'*(n=[label='#' just=c]*f=5. pctn=[label='%' just=c]*f=pctfmt6.*[style=[tagattr='Format: 0.0%']])
[/pre]

-- David Kelley, SAS
N/A
Posts: 0

Re: ExcelXP Tagset Options + Style Options in PROC Tabulate

Sorry, I must have missed your reply!

No, it didn't. Excel gives me an "Unable to read file" error when I try to open it up.

ExcelXP is a very tricky little devil...

-------------------------

EDIT: I figured it out! KEYWORD statement with my custom format solved the issue. (edited 14:34 PM 5/21/07 by ElayneR)

Message was edited by: ElayneR
Ask a Question
Discussion stats
  • 4 replies
  • 199 views
  • 0 likes
  • 2 in conversation