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.
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.
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.