11-28-2011 03:46 PM
I am writing a stored process which runs on Report Delivery Portal.
After user hit the run button, I do ods output to excel. Well, it does creates the excel file, but how do I prompt user to save the excel file which the ods has just created? I appreciate any help. Thanks.
11-28-2011 06:49 PM
When you run stored processes in the Information Delivery Portal (which is how I interpreted the "Report Delivery Portal" that you mentioned), if you use the correct STPSRV_HEADER function in your code to set the result type, you should get prompted to save the file when the stored process results come back to the browser.
There have been many posts in the Stored Process Forum about using STPSRV_HEADER, as well as examples of stored processes that return either ODS HTML, ODS CSV or ODS TAGSETS.EXCELXP output as stored process results. I'm not exactly sure what you mean when you say you "do ods output to excel" since ODS destinations are merely ASCII text files (either HTML, or CSV or XML) that Excel knows how to open and render. Only certain client applications on the BI Platform know how to receive stored process results that are "non standard" -- for example, the SAS Add-in for Microsoft Office can receive HTML or CSV results from a stored process without using an STPSRV_HEADER call in your code; but the SAS Add-in for Microsoft Office cannot receive TAGSETS.EXCELXP output -- which is where the Portal comes into play. You can create stored process results with TAGSETS.EXCELXP using the Information Deliver Portal, but generally, you need an STPSRV_HEADER function to change the default HTTP content-type header.
I'd recommend that you look in the Stored Process Forum postings for more information and examples relevant to this question.
12-05-2011 02:29 PM
Thank you for your input. As I am new to SAS programming, I do not know where to add STPSRV_HEADER in my stored process.I would apprecaite if you can write me back with a little more detail.
12-05-2011 03:00 PM
When I go to the Stored Process forum
http://communities.sas.com/community/sas_stored_processes and search on the string "STPSRV_HEADER", I come up with 2 pages of hits. The use of STPSRV_HEADER is off-topic in this forum (since this is the BASE SAS and Reporting Procedure forum -- which generally does not include much to do with the BI Platform). Since this question is related to stored processes and since I know that STPSRV_HEADER examples are posted in the Stored Process forum, I would recommend that you start there.
If you find that the examples that are posted on the stored process forum are not adequate to your need, then I would suggest that you either search for Tech Support notes and documentation on the support web site (for more like this http://support.sas.com/documentation/cdl/en/stpug/61271/HTML/default/viewer.htm#srvhead.htm ) and/or open a track with SAS Technical Support for help with your stored process.
Without looking at ALL your code and understanding your environment, it is hard to provide general information, since the use of STPSRV_HEADER is only required in some, but not all, stored processes.