Я сделал отчет о процедуре, и результат HTML, показанный в SAS, дает мне то, что я хочу, а именно:
Но в 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:
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";
Похоже, в основном это сработало. Я добавил параметры tagattr = "wrap:no" vjust=m asis=on в стиль (заголовок)