Usage Note 23689: How can I download an Excel file from an ODS HTML Web page?
You can place a download button on the HTML page that enables the reader to save the page as an Excel file. Use the Input tag along
with the document.execCommand JavaScript command in the PREHTML= attribute of PROC TEMPLATE. The arguments are SAVEAS and TRUE and the filename for the Excel file. If you specify a directory path in the filename, remember to provide
two slashes after the colon. This example will run on the Internet Explorer
browser only. Currently, other major browsers such as Mozilla do not support the SAVEAS argument of the execCommand method.
proc template;
define style styles.test;
parent=styles.default;
style body from body /
prehtml='<input
onclick="document.execCommand(''SAVEAS'',true,''c:\\test.xls'')"
value="Save As" type="button">';
end;
run;
ods html file='temp.html' style=styles.test;
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 | Windows | 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 Third Party ==> Programming ==> JavaScript SAS Reference ==> ODS (Output Delivery System)
|
Date Modified: | 2007-08-28 14:35:06 |
Date Created: | 2004-02-12 16:36:46 |