如何通过 proc 报告将 excel 中的单元格添加到另一个单元格上方


ods listing close;
ods tagsets.excelxp file='Y:fontsCC_ACQ_fonts_v2_har.xls' style=sasweb
options(sheet_name="CC_ACQ_JUN12_V2");
proc report data=work.matrix_input nowd
 style(report)={font_face=times font_size=1 font_weight=bold bordercolor=black}
 style(header)={font_face="Times New Roman" font_size=8pt  font_face=times    cellwidth=1in background=gray foreground=black font_weight=bold bordercolor=black  }
 style(column)={font_face="Times New Roman" font_size=8pt 
         just=center cellheight=15in font_face=times};
 column CELL offer_description pop product;
 run;
ods tagsets.excelxp close;
ods listing;

知道 excel 中的第一列是单元格知道上面的单元格(列名(我想写 BY:CELL(在另一个单元格中(上面offer_description流行产品(3 列(以上我想写 TOTAL Consilodate 邮件(以绿色为背景

这应该有效。 基本上,您使用 CROSS 变量来获取第二个标头,然后您必须放入一个非打印虚拟列才能使事情正常运行(您不能完全拥有 CROSS 变量(。 您可以使用样式语句输入颜色。 如果使用 PROC TEMPLATE 定义样式,则代码看起来会更简洁,这样就可以使用样式继承来避免一遍又一遍地重写样式。

data class;
set sashelp.class;
total='Total Consolidated';
namedummy='By Name';
dummy=' ';
run;
ods listing close;
ods tagsets.excelxp file='c:temptest.xml' style=sasweb
options(sheet_name="CC_ACQ_JUN12_V2");
proc report data=class nowd
 style(report)={font_face=times font_size=1 font_weight=bold bordercolor=black}
 style(header)={font_face="Times New Roman" font_size=8pt  font_face=times    cellwidth=1in background=gray foreground=black font_weight=bold bordercolor=black  }
 style(column)={font_face="Times New Roman" font_size=8pt 
         just=center cellheight=15in font_face=times};
 column dummy namedummy,name total,(age height weight);
define total/' ' across style={font_face="Times New Roman" font_size=8pt  font_face=times    cellwidth=1in background=green foreground=black font_weight=bold bordercolor=black };
 define namedummy/' ' across;
 define dummy/noprint;
 run;
ods tagsets.excelxp close;
ods listing;

相关内容

最新更新