SAS Proc 报告 - ODS EXCEL column/header 宽度

SAS Proc report - ODS EXCEL column/header width

我做了一份过程报告,SAS 中显示的 HTML 结果给了我想要的结果:

但是在 EXCEL 中,我得到的输出没有水平显示文本,它跳过了一行:

这是我的代码:

ods excel file = "" 
    options(sheet_interval='none' embedded_titles='yes') ; 

ods escapechar = '^'  ;
options missing = 0 orientation=landscape center ; 

proc report data = a split = '-' 
                                style(header)={background=white borderwidth=1 bordercolor=black width=150 color=black just=c textalign=c} 
                                style(report)={borderwidth=1 bordercolor=black just=c}
                                style(column)= {borderwidth=1 bordercolor=black just=r color=black tagattr='format:###,###,###,###,###0'}
                                style(summary)= [just=c textalign=c];
;

column ( '^{style[color=red]Total}'  ('Category (before change/extension) - Performing time'
        var1 var2 var3 );

define var1 / group; 
define var2 / analysis sum ; 
define var3 / analysis sum ; 

run ; 

我认为你“应该”这样做的方式是这样的:

{style[tagattr="wrap:no"]Category...

但是,当我测试它时,这对我来说并不能正常工作——它确实删除了换行,但它也删除了空格,而且它似乎不能与分隔符(连字符)一起正常工作).

你见过表流的 ods excel 选项吗?我有同样的问题,它对我有帮助;来自 SAS support document:

The ODS Excel destination is a measured destination that uses an algorithm to determine when text should wrap within a cell. This wrapping algorithm creates a best fit for columns so that they are not overly wide. When text does wrap within a cell, a carriage-return/line-feed character (CRLF) is added where the line break occurs.

...the most dynamic method is to use the FLOW= tagset option. The fourth maintenance release for SAS® 9.4 (TS1M4) introduces the ODS Excel destination's FLOW= suboption. When this option is specified, the Excel destination does not insert newline characters to force the text to wrap in the part of the output that is specified as an argument in the option. The FLOW= option also turns on the Wrap Text feature in Excel so that Excel will wrap the text to the column width.

Value Area Effected TABLES Enables flow of column headings, row headings, and data cells. HEADERS Enables flow for headings only. ROWHEADERS Enables flow for row headings. DATA Enables flow for data cells only.

The following example demonstrates the use of the ODS Excel destination along with the TITLE_FOONTNOTE_BREAK=, ABSOLUTE_COLUMN_WIDTH=, and FLOW= options.

Example 1. 
ods excel file="c:\temp1.xlsx" options(embedded_titles="Yes" 
                                        title_footnote_nobreak="yes" 
                                        flow="header,data" 
                                        absolute_column_width="75px,50px, 
                                        70px,50px,100px,125px,300px"); 
                                        ods text="Confidential Report";