Hi, Christa: In our reporting class, we teach how to use STYLE= overrides with PROC REPORT and PROC TABULATE. How each destination interprets those style overrides is up to the destination. For example, border lines look slightly different, thinner in RTF versus HTML. Each destination has its own way of dealing with style information (and format information) from SAS. Most of the destinations, "play nice" with the style and format information from SAS. Excel is notorious for ignoring information from SAS, such as column width, leading zero, number of decimal places, whether a column is a string, etc, etc. So while you can find out how to use STYLE overrides with PROC REPORT and PROC TABULATE, you have to test your overrides in every destination that will be opening your file. For example, when you use ODS, you can create either HTML or XML files that Excel knows how to open and render. So, if you run this code, and then, compare the 2 HTML files opened in a browser versus opened in Excel. (You will have to create them in SAS and then do a File --> Open from inside Excel). With one file (the Microsoft HTML open_mso_w_excel.html), Excel respects the overall color scheme; with the other file (HTML4 open_ht4_w_excel.html), Excel ignores the overall color scheme. Both files will look the same in Internet Explorer. The files will look different in Excel. Both files are HTML files. One "flavor" of HTML is Microsoft-friendly; the other "flavor" of HTML is the industry standard HTML. The XML file can also be opened in Excel and it will respect the overall color scheme because it is Microsoft "flavor" of XML. ods html file='c:\temp\open_ht4_w_excel.html' style=sasweb; ods msoffice2k file='c:\temp\open_mso_w_excel.html' style=sasweb; ods tagsets.excelxp file='c:\temp\open_xp_w_excel.xml' style=sasweb options(doc='Help'); proc print data=sashelp.class style(header)={background=pink}; run; ods _all_ close; Depending on what you want to do, you have to live with the rules of the destination. When you say you want to "center vertically" -- what do you want to center? A single header cell contents or all the data cell contents? Or do you mean that you want to influence the "center vertically" radio button (for the whole sheet) that is under the Page Layout menus inside Excel? In the above code, you also create an XML file, which you can open with Excel. The TAGSETS.EXCELXP file is an XML file that represents Spreadsheet Markup Language 2003 Microsoft XML. There are suboptions that you can specify which will accomplish things such as changing orientation, or altering the "center vertically" radio button, when the XML file is printed from Excel. These suboptions are written to the SAS log when you use the doc='Help' suboption, as shown in the above code. With TAGSETS.EXCELXP, my general rule of thumb is that I use STYLE= overrides to impact colors and fonts and possibly formats of the information that is coming from SAS. I use suboptions with TAGSETS.EXCELXP, to impact Excel menu choices or overall treatment of the sheet. The "Under the Hood" presentation and zip file that I posted previously has information and useful links about using suboptions with Excel. For more information about the types of STYLE attributes that you can change, refer to the documentation topic entitled 'Style Attributes and Their Values'. So, the answer to your question is "it depends" -- if I needed to make a header cell italic or center text in a header cell either horizontally or vertically, I would use a STYLE= override. If I needed to impact the "center vertically" radio button (which impacts the whole sheet), I would 1) use TAGSETS.EXCELXP as my destination and 2) use the center_vertically='on' suboption for TAGSETS.EXCELXP. If you wanted to know how to get Excel to respect leading zeroes in a variable value, I would use the TAGATTR style attribute, specifically with TAGSETS.EXCELXP. I presented a paper at SAS Global Forum this year (http://support.sas.com/resources/papers/proceedings11/266-2011.pdf) that showed how to use either TAGATTR or HTMLSTYLE style attributes with Excel. Other papers have been written on the same subject. My recommendation always is to learn what SAS can do (learn to use STYLE= overrides with PRINT, REPORT, TABULATE) and then, work to understand how your destination of interest deals with the STYLE information that you can send from SAS. In general, for most destinations, SAS does not provide a mechanism for you to interact with pull-down menus or options that are "inside" the application menu. TAGSETS.EXCELXP is unique in this regard -- through the available suboptions that you can specify. (To some extent, PDF is also unique in this regard, since SAS has system options that you can specify to alter the intial view of the PDF results when the ODS PDF file is first opened in Acrobat Reader. ) If I had to worry about delivering printable content, I would use PDF because 1) it is designed to be printed and 2) the contents are generally not editable unless you have a "full" version of Acrobat. cynthia
... View more