BookmarkSubscribeRSS Feed
Elliott
Obsidian | Level 7

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,

5 REPLIES 5
Jagadishkatam
Amethyst | Level 16

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
Elliott
Obsidian | Level 7

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

Ksharp
Super User

Post it at ODS and Base Reporting

You can add a style into it like:

style(header)={just=center}

Elliott
Obsidian | Level 7

where would I place this line in the code I posted?

Ksharp
Super User

Post it at ODS and Base Reporting

Cynthia will give you answer . Did you try the code offered by Jag. It looks like good .

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

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
  • 5 replies
  • 1550 views
  • 1 like
  • 3 in conversation