I am using ods to output a spreadsheet for my sas tables. Is there an option to center the column headings? I can put a filter on and lock the header row but I would like to center the column heading and make it bold if possible.
here is a sample of what I have so far:
ods listing close;
ods tagsets.excelxp
file=rptfl
options(embedded_titles='yes' minimize_style='yes' wraptext='no' AUTOFIT_HEIGHT='yes' )
rs=none style=Statistical;
ods noproctitle;
/*definitions tab*/
ods tagsets.excelxp options(sheet_name="Definitions" sheet_interval='none' embedded_titles='on' wraptext = "no"
absolute_column_width="9,55,20");
Thanks,
Hi,
I am not sure if there is a way to to control the column headers from the ods tagsets.excelxp options. However you could select a particular style and then by proc template you could modify that style and create your own style and apply this style in the ods tagsets.excelxp. something which i have done here.
sansPrinter is one of the ods tagsets.excelxp style available, which i have taken and modified the column headers as below and created a new style called XLsansPrinter which i again used in tagsets.excelxp.
proc template;
define style styles.XLsansPrinter;
parent = styles.sansPrinter;
style header from header /
font_size = 12pt
font_weight = bold
font_style = roman
just = left
vjust = bottom;
end;
run; quit;
ods tagsets.excelxp file='~path\class.xls' options(doc='help' autofilter='1' Frozen_Headers='yes') style=XLsansPrinter;
proc print data= sashelp.class ;
var name age height weight ;
run;
ods _all_ close;
Hope this helps you.
Thanks,
Jag
Thanks Jag, I have this working. Another question... do you know if you can make the header labels all in upper case with one of the style options. I have searched for information and am not finding it.
Thanks,
Cindy
where would I place this line in the code I posted?
Post it at ODS and Base Reporting
Cynthia will give you answer . Did you try the code offered by Jag. It looks like good .
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.