zoukankan      html  css  js  c++  java
  • sas ods excel输出多sheet,包含图片、目录等

    ods excel可以输出多表格 多图片到一个sheet中,相比较于其他的工具更好用。但是很多人并不知道怎么输出到多个sheet中,以下给出一个搜索到的解决方案。

     转载请注明出处:https://www.cnblogs.com/SSSR/p/11105838.html 

    有了此法就可以创建完整的excel报表了。

    先直接上代码:修改fbout的值即可运行,

    ods escapechar='~';
    %let bold_style=~S={font_size=12pt font_weight=bold}~;

    ods graphics / height=2.5in width=3.5in;
    filename fbout "D:projectsaspro tf_excel est.xlsx";

    ods excel file=fbout style=pearl options(embedded_titles="yes" contents="yes");

    ods excel options(sheet_interval="none" sheet_name='sheet1' );

    ods proclabel= "Detail Report of Males------------sheet1";

    title link="#'The Table of Contents'!a1" "Return to TOC";
    proc print data=sashelp.class;

    run;

    /*ods proctitle;*/
    ods text="&SYSDATE. Friend Report for";

    proc sgplot data=sashelp.class;
    scatter x=age y=height;
    run;

    /*用于输出多sheet,在每次需要生成新的sheet时增加此代码即可。。。*/
    ods excel options(sheet_interval='table');
    ods select none;
    proc means data=sashelp.class ;
    var age;
    run;
    /*用于输出多sheet*/ods select all;


    ods excel options(sheet_interval="none" sheet_name='sheet2');

    ods proclabel= "Detail Report of Females-------------sheet2";
    title link="test.xlsx - 'The Table of Contents'!A1" "Return to TOC";
    proc print data=sashelp.class;

    run;
    ods text="&bold_style.画图";
    proc sgplot data=sashelp.class;
    scatter x=age y=height;
    run;
    ods excel close;

    效果图:

     sheet1:

    sheet2:

  • 相关阅读:
    【第4题】 什么是https
    【第3题】 两个队列生成一个栈
    【第2题】 链表的逆置
    【第1题】 Pythonn内存管理以及垃圾回收机制
    tmunx error:invalid option: status-utf8 invalid option: utf8
    ubuntu install google-chrome-stable
    使用pyenv安装多个Python版本
    Linux命令行烧录树莓派镜像至SD卡
    freenode configuration sasl authentication in weechat
    尝试IRC & freenode
  • 原文地址:https://www.cnblogs.com/SSSR/p/11105838.html
Copyright © 2011-2022 走看看