|
9#

楼主 |
发表于 2005-4-11 08:37:17
|
只看该作者
one example
[code:1a502]* make sample reports ;
ods rtf file='c:\sample1.rtf' ;
proc means data=sashelp.class ; run ;
ods rtf close ;
ods rtf file='c:\sample2.rtf' ;
proc print data=sashelp.class ; run ;
ods rtf close ;
* Make a sample graph ;
filename out 'c:\test.png' ;
goptions device=png gsfname=out ;
proc gchart data=sashelp.class ;
hbar age ;
run ;
filename out ;
* Microsoft Word must already be running ;
filename word dde 'MSWORD|system' ;
* send DDE commands to MS WORD to combine files and create a new one ;
data _null_ ;
file word ;
put '[FileNew .Template = "normal.dot", .NewTemplate = 0]' ;
put '[toggleportrait]' ;
put '[ViewZoom .TwoPages]' ;
put '[ViewFooter]' ;
put '[FormatFont .Points=10, .Font="Arial", .Bold=1]' ;
put '[FormatParagraph .Alignment=1]' ;
put '[Insert "页脚"]' ;
put '[ViewFooter]' ;
put '[ViewHeader]' ;
put '[Insert "页眉"]' ;
put '[ViewHeader]' ;
put '[InsertPicture .name="C:\test.png"]' ;
put '[WordLeft]' ;
put '[SelectCurWord]' ;
put '[FormatPicture .scalex=150, .scaley=150]' ;
put '[WordRight]' ;
put '[insertpagebreak]' ;
put '[InsertFile .name="C:\sample1.rtf"]' ;
put '[InsertFile .name="C:\sample2.rtf"]' ;
put '[FileSaveAs .name="c:\test.doc"]' ;
put '[FileClose]' ;
run ;[/code:1a502] |
|