BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
SASAlex101
Quartz | Level 8

I have a web application which uses _webout as the ods destination and the procs return an xlsx file. I have the following application headers: 

data _null_;
rc = stpsrv_header('Content-type','application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
rc = stpsrv_header('Content-disposition','attachment; filename=SomeReport.xlsx');
run;

When I call the stored proc from Edge, what happens is that the file download dialogue will appear like this: 

SASAlex101_0-1692822317499.png

 

However what I'd like is for the browser to download the file automatically using the flyout menu like this: 

SASAlex101_1-1692822659485.png

 

Through research, it may appear that the header's are incorrect and/or the stored proc is not returning the (recognizable) binary content of the xlsx file. Is this true? The file I'm getting is an excel file. I open it and it works fine. Where in the stored proc would I ensure the binary content is valid and recognizable as an xlsx? is it something I set in the SP targets wizard?  

 

I've ruled out the java script in the webpage code as I can run the hyperlink of the stored process directly in my browser without javascript to test reports and it results in the same behavior. 



1 ACCEPTED SOLUTION

Accepted Solutions
Quentin
Super User

I would think that is browser behavior, so you'd have to see how Edge decides what to do with a file.  From this page, it looks like users can configure their browser download options:

https://onlinecomputertips.com/support-categories/software/edge-download-options/

 

For downloading Excel files, I use:

rc = stpsrv_header('Content-type','application/vnd.ms-excel');

you might try that and see if it makes Edge handle it differently.

 

When I use that an Edge, I get a little download popup:

Edge.PNG

Note your first picture says it's from internet explorer, not Edge.

BASUG is hosting free webinars ! Check out recordings of our past webinars: https://www.basug.org/videos. Save the date for our in person SAS Blowout on Oct 18 in Cambridge, MA. Registration opens in September.

View solution in original post

3 REPLIES 3
Quentin
Super User

I would think that is browser behavior, so you'd have to see how Edge decides what to do with a file.  From this page, it looks like users can configure their browser download options:

https://onlinecomputertips.com/support-categories/software/edge-download-options/

 

For downloading Excel files, I use:

rc = stpsrv_header('Content-type','application/vnd.ms-excel');

you might try that and see if it makes Edge handle it differently.

 

When I use that an Edge, I get a little download popup:

Edge.PNG

Note your first picture says it's from internet explorer, not Edge.

BASUG is hosting free webinars ! Check out recordings of our past webinars: https://www.basug.org/videos. Save the date for our in person SAS Blowout on Oct 18 in Cambridge, MA. Registration opens in September.
SASAlex101
Quartz | Level 8

Wow that's weird. I am using edge, but for some reason the popup is from IE. I didn't notice that. 
Turned out that both content type headers work in Chrome - I get the flyout menu downloaded as an excel file. but not Edge. Perhaps the Edge I'm working with is trash. 

 

Marking solved as you're right; it's simply browser behavior. 

AlanC
Barite | Level 11

Keep in mind that modern Edge uses the Chromium engine so same as Chrome. That may/may not be relevant but, im general, Chrome and Edge should work mostly the same. Same extensions work in both.

 

If you have an ancient version of Edge, that would be an issue. Check file associations as well. Remove IE if possible. That should be doable depending on your version of Windows.

https://github.com/savian-net

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

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
  • 3 replies
  • 567 views
  • 0 likes
  • 3 in conversation