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:

  • 相关阅读:
    完全卸载 Oracle
    Windows 下 Oracle 10g 手工创建数据库
    zip & unzip 命令
    J2EE的13种核心技术规范
    Windows 8发行预览版序列号
    wget百度百科
    Application's Life Cycle
    当前网络存在的安全问题
    Ubuntu 11.10 更换 LightDM 开机登录画面
    tmp文件夹的默认权限
  • 原文地址:https://www.cnblogs.com/SSSR/p/11105838.html
Copyright © 2011-2022 走看看