BookmarkSubscribeRSS Feed
mdavidson
Quartz | Level 8
Is there a way to have SAS create something similar to an autofilter in excel on a data output (list data or HTML output)? Is that even possible?
6 REPLIES 6
Cynthia_sas
SAS Super FREQ
Hi:
There are two ODS DESTINATIONS that will allow you to set autofilters:

1) TAGSETS.TABLEEDITOR -- creates an HTML file that can be viewed in a browser or in Excel

2) TAGSETS.EXCELXP -- creates an Excel Spreadsheet Markup Language file with the ability to set AUTOFILTER to on -- so that when the file is opened in Excel, you will see the AUTOFILTERS (this file cannot be opened in a browser, only with Excel)

However, neither of these destinations is automatically available to you under the EG choices for output types. You can create SAS code in an EG code node to use either of these two ODS destinations (assuming 1) you have SAS 9 on your server and 2) both tagset definitions are available on the server -- you will have to download both of these tagset definitions and make sure they're on the server before you use them).

For more information about TAGSETS.TABLEEDITOR:
http://www2.sas.com/proceedings/forum2008/258-2008.pdf -- contains code examples, such as this one:
[pre]
ods tagsets.tableeditor file="filename.html"
style=styles.printer
options(header_bgcolor="maroon"
header_fgcolor="white"
rowheader_bgcolor="maroon"
rowheader_fgcolor="white"
data_bgcolor="beige"
sort="yes"
autofilter="yes"
autofilter_width="4em");

proc print data=sashelp.class(obs=10);
title “Sort and filter columns”;
run;
ods tagsets.tableeditor close;
[/pre]

Note: the above code will NOT work until you have installed the TableEditor tagset template definition on your SAS installation or server.

For more information about TAGSETS.EXCELXP:
http://support.sas.com/rnd/base/ods/odsmarkup/

cynthia
mdavidson
Quartz | Level 8
Cynthia,

I'm getting the following error when attempting to install tableeditor.tpl. Is this an issue with my permissions or a SAS issue?
darrylovia
Quartz | Level 8
SAS EG is defaulted to make sasuser(readonly). To get around that you can put the template into work. So add this line

ODS PATH work.templat(update) sasuser.templat(read)
sashelp.tmplmst(read);
before your %include statemet. (%include 'C:\tableEditor.tpl';)

-Darryl
mdavidson
Quartz | Level 8
I just figured that out before you posted. Thanks anyways Darryl.

I added this code (before my %include):

ODS PATH work.templat(update) sasuser.templat(read)
sashelp.tmplmst(read);
mdavidson
Quartz | Level 8
My next question: Now that I've got the autofilters to work on an HTML output with the EGDefault style, is it possible to get autofilters to work on a custom style? I'm trying to use my own style, and the autofilters are not populating. Any ideas?
Cynthia_sas
SAS Super FREQ
Hi:
I think the best source for help on the Tableeditor tagset is in Tech Support. You might try there for help. You should be able to make it work with a custom style template.

cynthia

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 1465 views
  • 0 likes
  • 3 in conversation