BookmarkSubscribeRSS Feed
matt_H
Calcite | Level 5

Good afternoon-

 

My first post in the community and a SAS novice so please excuse any lapses in etiquette.

 

I'm trying to get accustomed to the ODS Excel system and having an issue.

 

What I'm trying to do is output 3 tables with text onto one Excel sheet, then output another table onto the second sheet.

 

I'd like to have autofilters turned on in the second sheet.  The problem is that the filters are showing up in row 6 of the second sheet, as opposed to row 1 where the headers are.  I believe this is because the first sheet has 5 lines of ODS text which seems to be causing the second sheets filters to move down 5 rows.

 

If I comment out the ODS Text lines the autofilters work fine on the second sheet.

 

Any suggestions are welcome.

 

 

ODS EXCEL FILE="&OUT1."

style=barrettsblue

options(

sheet_interval="none"

sheet_name="Summaries"

);

 

 ods escapechar='~';

ods text="~S={font_size=14pt font_weight=bold}~UM Auth Turnaround Time";

ods text="~S={font_size=12pt font_weight=bold font_style=italic}~Auths Received Between &BEG_PRINT. and &END_PRINT.";

ods text="~S={font_size=12pt font_weight=bold font_style=italic}~Summary by User, User Type & Aggregate";

ods text="~S={font_size=12pt font_weight=bold}~ ";

ods text="~S={font_size=12pt font_weight=bold font_style=italic}~Aggregate Summary";

 

proc report data=SUMM;

run;

 

ods text="~S={font_size=12pt font_weight=bold font_style=italic}~Summary By User Type";

proc report data=SUMMTYPE;

run;

 

ods text="~S={font_size=12pt font_weight=bold font_style=italic}~Summary By User";

proc report data=SUMMUSER;

run;

 

ODS EXCEL style=barrettsblue

options(

frozen_headers="1"

autofilter="ALL"

sheet_name="Detail"

);

proc report data=UMSV1;

run;

   ods excel close;

1 REPLY 1
Cynthia_sas
SAS Super FREQ

Hi:

  I'm not sure what's going on. This works for me:

 

ods excel file='/folders/myfolders/all_output/test_filters.xlsx'
    options(autofilter='none' sheet_name='No filters');
proc print data=sashelp.class;
run;
 
ods excel options(autofilter='3-5' sheet_name='Filters on 3 4 5');
proc print data=sashelp.cars(obs=20);
run;
 
ods excel options(autofilter='all' sheet_name='filter all');
proc print data=sashelp.shoes(obs=20);
run;
 
ods excel close;

 

I get no filters in the first sheet, 3 columns with filters in the second sheet and all columns with filters in the 3rd sheet. The key is resetting the value for filters each time. As for the statement that the filters show up in row 6, that sort of makes sense because you have so many lines of ODS TEXT (not sure why you're using that instead of a TITLE statement with embedded_titles, but that's another issue). But as for WHY the ODS TEXT is impacting the filters on the subsequent sheets, that is a question for Tech Support.

 

Anyway, for help with WHERE the filter is going, with your specific code, you might want to work with Tech Support. If you have discovered a bug, that is something they need to investigate and report.

 

cynthia

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 10612 views
  • 1 like
  • 2 in conversation