Hello,
We have a STP program that uses the following belowfor the STP to output in Excel
data _null_;
/* Set HTTP headers */
rc = stpsrv_header('Content-type','application/vnd.ms-excel');
/* Prompt to SAVE or OPEN the attachment file named test.xls using Excel */
rc = stpsrv_header('Content-disposition','attachment; filename=filename.xls');
/* OR */
/* Open results directly to Excel (browser-dependent) *
rc = stpsrv_header('Content-disposition',"inline"); */
run;
WHen using Proc Print it outputs to Excel ; but not if using PROC REPORT.
Any ideas?
You will need to show how you are doing it. If you proc report to ods tagsets.execelxp and call it xlsx then that is a mismatch as tagsets creates XML output.
What is the proc print / proc report doing? The reason being there are many ways to create Excel files - tagsets.excelxp, libname excel, etc. It could also be that the proc report is not working and creating an invalid Excel file. You haven't said what happens when the proc report is used, is there an error, does it open and there is no data, does nothing happen? What does the log of the proc report say - maybe there is an error? Maybe your missing a style, or you haven't specified columns in the proc report - I get this, when columnsis not given you wont get output.
When running with PROC PRINT; Excel is opened however with PROC REPORT it attempts to open an unknown file type:
we get a File Doanload Prompt with the Name result._WEBOUTUnknown Type:Unknown File Typpe From: the location of the file.
You will need to show how you are doing it. If you proc report to ods tagsets.execelxp and call it xlsx then that is a mismatch as tagsets creates XML output.
thank you; your answer helps me clarify our issue.
Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.