Usage Note 23342: How can I add a button to my ODS HTML output?
Navigational buttons can be added to the HTML file a number of ways.
One way is to use PROC TEMPLATE as illustrated below using
the POSTHTML= attribute in the style element Table if the button is to
appear after every table, or the style element Body if it is to
appear once after all tables. You can also append the HTML to the end
of the file, and you can add HTML tags to the FOOTNOTE statement.
View output.
/* The below opens the the SAS web site when the button is clicked. */
proc template;
define style styles.test;
parent=styles.default;
style table from output /
posthtml='<div align="center"><input type="button" value="SAS"
onclick=javascript:window.open("http://www.sas.com")></div>';
end;
run;
/* The below includes both a BACK button and a window open button */
proc template;
define style styles.test;
parent=styles.default;
style table from output /
posthtml='<div align="center"><input type="button" value="Open SAS"
onclick=javascript:window.open("http://www.sas.com")>
<input type="button" value="BACK"
onclick="history.back()"></div>' ;
end;
run;
/* The below example adds a button to close the window */
proc template;
define style styles.test;
parent=styles.default;
style table from output /
posthtml='<div align="center"><input type="button" value="Open SAS"
onclick=javascript:window.open("http://www.sas.com")>
<input type="button" value="BACK"
onclick="history.back()">
<input type="button" value="FORWARD"
onclick="history.forward()">
<input type="button" value="CLOSE WINDOW"
onclick=javascript:window.close()></div>' ;
end;
run;
/* The final example adds a print button */
proc template;
define style styles.test;
parent=styles.default;
style table from output /
posthtml='<div align="center"><input type="button" value="Open SAS"
onclick=javascript:window.open("http://www.sas.com")>
<input type="button" value="BACK"
onclick="history.back()">
<input type="button" value="FORWARD"
onclick="history.forward()">
<input type="button" value="CLOSE WINDOW"
onclick=javascript:window.close()>
<input type="button" value="PRINT PAGE"
onclick=javascript:window.print()></div>' ;
end;
run;
ods html body='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
*
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: | SAS Reference ==> ODS (Output Delivery System) Third Party ==> Programming ==> JavaScript
|
Date Modified: | 2003-09-22 11:20:37 |
Date Created: | 2003-08-07 17:53:36 |