Usage Note 23397: For ODS HTML output, how can I collapse my BY-groups until I click on the procedure name?
To have the tree collapsed by default in the table of contents, you can modify a JavaScript
variable display_mode = "none" to display_mode = "block". This works in Internet Explorer. Follow these steps:
- Specify the CODE= option on the ODS HTML statement to save the JavaScript
file at a pathname of your choice. In the example blow, the file is saved to c:\javascript.js.
The BODY file is required
syntax but the body file itself is not important and can be deleted
after the program runs.
ods listing close;
/* body file is required - use any name */
ods html body='body.html' code= 'c:\javascript.js';
/* some proc is required - use any simple proc */
proc print data=sashelp.class;
run;
ods html close;
- Modify the JavaScript file (c:\javascript.js in our example)
by opening it in a text editor. Find lines 17-18. Change
// Initialize expander
var display_mode = "none"
to
// Initialize expander
var display_mode = "block"
Save and close the file. This has to be done only once.
- Now you can apply this modified JavaScript file
to a table of contents by specifying CODE=(URL="filename") on the ODS HTML statement
as follows. View output.
ods listing close;
/* Use the same filename and path for URL= as you did for CODE= */
ods html body='body.html' contents='contents.html' frame='frame.html'
code=(url='c:\javascript.js');
/* this is just an example to get a nontrival table of contents */
goptions dev=activex xpixels=500 ypixels=400;
proc print data=sashelp.class;
run;
proc gplot data=sashelp.class;
plot height*weight; run;
plot height*age; run;
plot weight*age; run;
quit;
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 Third Party ==> Output ==> HTML
|
Date Modified: | 2004-08-20 16:46:57 |
Date Created: | 2003-08-19 12:02:27 |