Your SAS programs, embedded in web apps and elsewhere

SPWA tagsets.ExcelXP not opening in Excel

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 7
Accepted Solution

SPWA tagsets.ExcelXP not opening in Excel

I have a simple STP, code below, invoked from the SPWA which is writing tagsets.ExcelXP output.  I've tried different combos of the filename suffix, setting the MIME via stpsrv and appsrv, specifying "file=_webout", nothing works.  The output only displays in a new browser window ( the XML is 100% correct, I can copy / save and open successfully with Excel 2010 ).  Searching ODS and STP communities, been beating my head against the wall toooooo long, any insight will be most appreciated.

The browser is IE v7 ( I know, corp standard!! ).

%let _odsdest = tagsets.excelXP;

%let _odsoptions =;

%let _odsstyle = sasweb;

%let dto = %sysfunc(putn("&dt"d,yymmddd10.));

%let rv = %sysfunc( stpsrv_header('Content-type','application/vnd.ms-excel') );

%let rv = %sysfunc( stpsrv_header('Content-disposition',"attachment; filename=mor_missing_system_userids_&dto..xml"));

%STPBEGIN;

<snip>

*  End EG generated code (do not edit this line);

<snip>

ods tagsets.excelxp

  options ( sheet_name = 'Overall' absolute_column_width='30,10' zoom='80');

ods listing close;

ods noresults;

proc print data = system_nm noobs label;

  label system_nm = 'System NM'

  cnt = 'Count';

  format cnt comma12.;

run;

ods tagsets.excelxp style=statistical

  options ( sheet_name = 'none'

  sheet_label = ' '

  sheet_interval = 'Bygroup'

  absolute_column_width = '10,10,15,25,25,30,7'

  embedded_titles = 'yes'

  autofilter = 'yes'

  zoom = '80'

  );

proc report data = warning_defaulted_srf_d nowindows ;

  by system_nm;

  columns employee_project_nm employee_pillar_nm employee_department_nm reporting_entity_nm

  event_userid comment cnt;

<snip>

run;

ods tagsets.excelxp close;

ods listing;

ods results;


Accepted Solutions
Solution
‎03-17-2014 03:26 PM
PROC Star
Posts: 1,322

Re: SPWA tagsets.ExcelXP not opening in Excel

My code for stpsrv_header doesn't have thoe quote marks in your code.  Don't need them in macro %LET statement.

That could definitely be the problem.  Mine looks like:

  %let rc=%sysfunc(stpsrv_header(Content-type,application/vnd.ms-excel));
  %let rc=%sysfunc(stpsrv_header(Content-disposition,attachment%str(;) filename=ReportFile.xls));

View solution in original post


All Replies
PROC Star
Posts: 1,322

Re: SPWA tagsets.ExcelXP not opening in Excel

Quick glance, looks reasonable.

Why the second line? :

  %let _odsoptions= ;

Maybe that is over-writing some options set by SPWA.

Occasional Contributor
Posts: 7

Re: SPWA tagsets.ExcelXP not opening in Excel

Quentin:  I commented out the _odsoptions line, same thing...

Solution
‎03-17-2014 03:26 PM
PROC Star
Posts: 1,322

Re: SPWA tagsets.ExcelXP not opening in Excel

My code for stpsrv_header doesn't have thoe quote marks in your code.  Don't need them in macro %LET statement.

That could definitely be the problem.  Mine looks like:

  %let rc=%sysfunc(stpsrv_header(Content-type,application/vnd.ms-excel));
  %let rc=%sysfunc(stpsrv_header(Content-disposition,attachment%str(;) filename=ReportFile.xls));
Occasional Contributor
Posts: 7

Re: SPWA tagsets.ExcelXP not opening in Excel

Bingo.  Initially I had the STPSRV invocations in a data _null_, made them macro and forgot to take off the quotes....

Thanks much Quentin.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 984 views
  • 0 likes
  • 2 in conversation