The SAS Output Delivery System and reporting techniques

ODS and ExcelXp - vertical cell merge

Reply
Occasional Contributor
Posts: 14

ODS and ExcelXp - vertical cell merge

Hi,

Can any one suggest how to merge cells in a column in ods excelxp.Below is a screenshot of something I am looking for.Thanks.

screenshot.png

SAS Super FREQ
Posts: 8,645

Re: ODS and ExcelXp - vertical cell merge

Hi:

  Both PROC REPORT and PROC TABULATE will allow "nested" groups, where the primary group value "spans" the secondary group value. However, that only takes care of the spanning. You also indicated that you wanted font rotation. The spanning that you get from PROC REPORT and PROC TABULATE do not automatically include the rotation that you show.

   Whether you can do the rotation you want depends on whether Microsoft Excel has a style definition for font rotation in the XML specification for Spreadsheet Markup Language XML 2003.

  The only "simple" thing you can do from the SAS side of things is to insert a line feed between each character in the primary group values. Whether you can rotate the font is a question for Tech Support. The only destination that I know that can rotate headers is the MSOFFICE2K_X destination, which creates HTML files that Excel knows how to open and render.

cynthia

ods listing close;

proc sort data=sashelp.cars;

  by make model;

  where make in ("Volkswagen" "Volvo");

run;

    

ods tagsets.excelxp file='c:\temp\spanrows.xml' style=sasweb;

  

proc tabulate data=sashelp.cars;

  class make model;

  classlev make model /

           style=Header{vjust=m};

  var mpg_city mpg_highway;

  table make*model all,

        mpg_city*(min mean max);

run;

  

proc report data=sashelp.cars nowd spanrows;

  column make model mpg_city,(min mean max);

  define make / group

         style(column)=Header{vjust=m};

  define model / group

         style(column)=Header{vjust=m};

  define mpg_city/analysis;

run;

ods _all_ close;

Post a Question
Discussion Stats
  • 1 reply
  • 1549 views
  • 0 likes
  • 2 in conversation