Hi:
Well, for some reason, I had to put just=c into a style template. I could not get centering working with the center command in the TITLE statement or in the ESCAPECHAR style override.
I -did- manage to get the HEIGHT working for the TITLE line. If you say autofit_height='no' then you can set a specific row height for the title using the ROW_HEIGHTS suboption.
But then, since the title needs to span ALL the columns, I had odd wrapping for the XXX, YYY and ZZZ -- so I needed to increase the width of every column so that all the columns together would be wide enough to fit the long text.
Last, I had to use the special string that represents Alt+Enter for Excel -- that is the string. Excel only allows you to specify a "return" in a cell by typing Alt+Enter. Apparently, the way you specify the equivalent of Alt+Enter in a Spreadsheet Markup Language XML file is
...and so that special string needed to have protectspecialchars set to off so the & would not get turned into & when it was used. (Just like < gets "protected" by being turned into < and > gets turned into > )
cynthia
[pre]
options noquotelenmax;
ods path work.ttt(update) sasuser.templat(update) sashelp.tmplmst(read);
proc template;
define style styles.kb;
parent=styles.default;
class SystemTitle from SystemTitle /
just=c;
end;
run;
%let t1=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx;
%let t2=yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy;
%let t3=zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz;
ods _all_ close;
ods tagsets.excelxp file='c:\test long titles.xls' style=styles.kb
options(embedded_titles='yes'
gridlines='yes'
autofit_height='no'
row_heights='0,0,0,50,0,0,0');
ods tagsets.excelxp options(sheet_name='XXX XXXXX');
ods escapechar='^';
title f="Century Gothic" h=8pt "^{style [protectspecialchars=off font_size=8pt]&t1%str( )&t2 %str( )&t3 }";
proc print data=sashelp.class
style(column)={cellwidth=1.75in};
run;
ods _all_ close;
[/pre]