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 .

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 677 views
  • 1 like
  • 3 in conversation