Amadeus cookies policy - you'll see this message only once.

Amadeus use cookies on this website. They help us to know a little bit about you and how you use our website, which improves the browsing experience and marketing - both for you and for others. They are stored locally on your computer or mobile device. To accept cookies, continue browsing as normal. Or, go to the privacy policy for more information.

Producing Enhanced HTML Reports using the ODS TABLEEDITOR Tagset

The ODS TABLEEDITOR tagset enables us to produce sophisticated HTML reports which exhibit similar characteristics to reports created using Microsoft Excel or Visual Basic .NET. The tagset can be downloaded from the ODS Markup Resources page on the SAS Support site in the form of a ZIP file which contains a host of examples along with the tagsets definition, saved in a TPL file. When extracted and submitted within SAS, this allows us to make use of the TABLEEDITOR tagset as an ODS destination.

This tip aims to demonstrate a couple of examples of using the TABLEEDITOR tagset to significantly enhance the presentation of HTML output.

In our first example the TABLEEDITOR tagset is used to generate HTML output with both autofilters and frozen headers activated. The autofilters have a default width uniformly assigned and have been defined for the first seven columns. Frozen headers have also been activated enabling us to scroll through the data listing whilst still being able to view column headings, in a similar fashion to Excel.

%inc 'tableeditor.tpl'; 
title "Listing of Product Sales"; 
ods listing close; 
ods tagsets.tableeditor file="Sales_Report_1.html" 
    style=styles.meadow 
    options(autofilter="YES" 
 	    autofilter_table="1" 
            autofilter_width="6em" 
 	    autofilter_endcol= "7" 
            frozen_headers="YES" 
            frozen_rowheaders="YES" 
            ) ; 
 	proc print data=sashelp.prdsale noobs; 
   		var year quarter month country region prodtype 
 		    product actual predict; 
   		format actual predict nlmnlgbp12.2; 
 	run; 
ods tagsets.tableeditor close; 
ods listing; 

In order to view the resulting output it will be necessary to permit Internet Explorer to run Active X controls.

In our second example the TABLEEDITOR tagset is used to generate a HTML file with two reports, each of which is displayed on a separate tab which are named in the 'options' supplied on the opening ODS statement.

ods listing close; 
ods noproctitle; 
ods tagsets.tableeditor file="Sales_Report_2.html" 
    style=styles.meadow 
    options(web_tabs="First Report,Second Report"); 
    title "Summary of product sales"; 
    proc means data=sashelp.prdsale mean min max maxdec=2; 
   	class prodtype product; 
   	var actual predict; 
    run; 
    title "Mean product sales by country"; 
    proc tabulate data=sashelp.prdsale format=nlmnlgbp12.2; 
    	class prodtype product country; 
   	var actual predict; 
   	table prodtype*product,country*(actual*mean='' 
                                        predict*mean=''); 
    run; 
ods tagsets.tableeditor close; 
ods listing; 

First Report:

Producing Enhanced HTML Reports using the ODS TABLEEDITOR Tagset Image 1

Second Report:

Producing Enhanced HTML Reports using the ODS TABLEEDITOR Tagset image 2

The TABLEEDITOR tagset is available for use in SAS 9.2 and produces report formats which are supported by Internet Explorer.

At time of publication, ODS TABLEEDITOR tagset could be downloaded from: http://support.sas.com/rnd/base/ods/odsmarkup/tableeditor/tableeditor.zip