添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Usage Note 23689: How can I download an Excel file from an ODS HTML Web page?

Details About Rate It

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">'; ods html file='temp.html' style=styles.test; proc print data=sashelp.class; ods html close;

See also the full PROC TEMPLATE FAQ and Concepts .



Operating System and Release Information

Product Family Product System SAS Release
Reported Fixed*
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

This content is presented in an iframe, which your browser does not support. To view the RateIT tab, click here.