![]() | ![]() | ![]() | ![]() |
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.
Product Family | Product | System | SAS Release | |
Reported | Fixed* | |||
SAS System | Base SAS | Windows | n/a |