Usage Note 23650: How can I generate RTF, XML, PDF, and Excel files with ODS and SAS/IntrNet?
You can use the APPSRV_HEADER function to override the default mime header
that ODS generates. The below examples use the function to change the
content-type in order to render the desired kind of output.
The function is available in Release 8.1 and later.
/* Sending RTF output directly to a browser */
%let RV=%sysfunc(appsrv_header(Content-type, application/msword));
ods rtf body=_webout;
proc print data=sashelp.class;
run;
ods rtf close;
/* Sending XML directly to the browser */
libname _webout XML;
data _null_;
rv=appsrv_header(Content-type, 'text/xml' );
run;
proc sql;
create table _webout.shoes as
select * from webdata.shoes;
quit;
/* Creating PDF by using SAS/IntrNet */
%let rv = %sysfunc(appsrv_header(Content-type,application/pdf));
ods printer body=_webout pdf;
proc print data=sashelp.class;
run;
ods printer close;
/* Creating Excel output by using SAS/IntrNet */
%let RV=%sysfunc(appsrv_header(Content-type, application/vnd.ms-excel));
%let RV=%sysfunc(appsrv_header(Content-disposition,
%str(attachment; filename=temp.xls)));
ods html body=_webout;
proc print data=sashelp.class;
run;
ods html close;
See also the full PROC TEMPLATE FAQ and Concepts.
Operating System and Release Information
| SAS System | Base SAS | All | n/a | |
| SAS System | SAS/IntrNet | All | n/a | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
| Type: | Usage Note |
| Priority: | low |
| Topic: | Data Management ==> Data Sources ==> External Databases ==> MS Excel SAS Reference ==> ODS (Output Delivery System) Third Party ==> Output ==> RTF Third Party ==> Output ==> Postscript Third Party ==> Output ==> PDF Third Party ==> Output ==> HTML
|
| Date Modified: | 2007-10-03 10:51:59 |
| Date Created: | 2004-01-09 14:58:32 |