BookmarkSubscribeRSS Feed
OS2Rules
Obsidian | Level 7
Hi All:

I'm using the ExcelXP tagset to create a number of multi-tab spreadsheets. The user has some very specific design requirements for these and I am having some problems getting them just right.

For example, the user wants to 'right justify' the word 'Subtotals:' on the sheet. I'm using a COMPUTE block to output the subtotal but I'm not sure how to justify the text in the cell. (I'm using a CALL DEFINE to provide font, background, and format already).

Is there a comprehensive list of the attributes that can be changed in the tagset using the 'CALL DEFINE'? Do I use the SAS format (".J=Right"), the HTML format ("align=right") or the XML format ("ss:Horisontal="Right")? If the attribute was not assigned to the "style", can it be altered by a CALL DEFINE statement?
2 REPLIES 2
Chevell_sas
SAS Employee
One way that this can be done is to apply the styles in the template. The style element created in the template can then be used with the STYLE= parameter of the CALL DEFINE statement.

proc template;
define style styles.test;
parent=styles.default;
style right from data /
font_size=8pt
background=red
just=right;
end;
run;

ods tagsets.excelxp file="temp1.xls" style=styles.test;

proc report data=sashelp.class nowd;
column name age sex height weight;

compute sex;
if sex="F" then call define(_col_,"style","style=right");
endcomp;

run;

ods tagsets.excelxp close;
Cynthia_sas
Diamond | Level 26
chevell:
I thought .r was already defined or will that not work for ExcelXP????
cynthia

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1118 views
  • 0 likes
  • 3 in conversation