SAS - Ods tagsets.excelxp& proc报告 - 公式未与中心对齐的列

时间:2016-11-09 13:33:31

标签: sas proc-report

我需要你的帮助!

我正在尝试使用proc报告在SAS中创建输出。 虽然我在选项中使用center_vertical&如下所示,center_horizo​​ntal输出中的“失败规则”(计算)列不是居中的,而是与左侧对齐。 有人可以帮忙吗?

options missing = "";
ods listing close;
ods tagsets.excelxp style=mystyle file="./Pre-Model_Diagnostic_&ProjectName..xml"
options(Sheet_Name="Pre-Model Diagnostic" hidden_columns="&HideCol"
        autofit_height='yes' autofilter='all' frozen_rowheaders='2' frozen_headers='yes' width_fudge='1.25' center_vertical='yes' center_horizontal='yes' )

.
.
.
.
    define OverallRule_Fail  /"Fail/Rule"    center ;   
    define OverallRule_Watch  /"Warning/Rule"  center ; 
    define FailingRule   /"Failing/Rule"   center style(column)={tagattr='Formula:RC[-2]&char(10)&RC[-1]'}  ;

compute FailingRule;
if missing(OverallRule_Fail)=0  
then call define(_col_,"style","style={background=%RGBHEX(210,073,042) foreground='black' fontfamily=calibri}");
else if missing(OverallRule_Fail)=1 and missing(OverallRule_Watch)=0 
then call define(_col_,"style","style={background=%RGBHEX(238,182,169) foreground='black' fontfamily=calibri}");
endcomp;

1 个答案:

答案 0 :(得分:0)

compute FailingRule /character length=20; 设为字符字段。

stops: [
            [0, '#00007F'],
            [0.125, 'blue'],
            [0.25, '#007FFF'],
            [0.375, 'cyan'],
            [0.5, '#7FFF7F'],
            [0.625, 'yellow'],
            [0.75, '#FF7F00'],
            [0.875, 'red'],
            [1, '#7F0000']
        ]

这似乎让它适合我。