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.

The Boston Area SAS Users Group is hosting free webinars!
Next webinar will be in January 2025. Until then, check out our archives: https://www.basug.org/videos. And be sure to subscribe to our our email list.

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.

The Boston Area SAS Users Group is hosting free webinars!
Next webinar will be in January 2025. Until then, check out our archives: https://www.basug.org/videos. And be sure to subscribe to our our email list.
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: 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
  • 3 replies
  • 712 views
  • 0 likes
  • 3 in conversation