今日分享的小知识使用ODS Excel/tagsets.excelxp输出,如何给指定单元格添加批注。
单元格添加批注
可在Proc Report中利用flyover语句来实现,如下代码所示。
代码语言:javascript复制proc report data=contents_indx headskip headline nowd style(header)={just=c asis=on font_weight=bold font_style=italic} ;
column ("Contents" I LIB dsn SheetName Description comments nobs );
define i/display "SEQ" style=[ just=left tagattr='text' ];
define SheetName/ display "Sheet Name" style=[ just=left tagattr='text'];
define Description/display "Description" style=[ just=left tagattr='text' ] ;
define comments/computed display "Comments" style=[ just=left tagattr='text' ] ;
define nobs/display ;
define nobs / noprint;
compute before _PAGE_/ style = [ font_style=italic just=l font_weight=bold font_size=8pt borderbottomcolor=black borderbottomwidth=.5pt background=white ];
endcomp;
compute comments ;
if comments ne '' and nobs ne 0 then do;
urlstring = "#" ||strip(SheetName)|| "!A1";
stylestring= "style=[flyover='" ||strip(comments)|| "']";
call define(_col_, 'style', stylestring);
call define(_col_, 'URL', urlstring);
end;
endcomp;
run;
更多资源
更多Excel输出相关更多内容可见历史文章, 也可再我的网站(统计编程-云文件-Excel输出宏)上下载相关程序。