Your SAS programs, embedded in web apps and elsewhere

Problem while exporting the output to excel

Reply
N/A
Posts: 0

Problem while exporting the output to excel

Hi
I have requirement to export report output to excel using the below piece of code as a Stored Process at runtime
I have Microsoft office 2007.
/**************************************/
%global _odsdest _odsoptions ;
%let _odsdest = tagsets.excelXP;
%let _odsoptions =;
%let rv = %sysfunc(appsrv_header(Content-type,application/vnd.ms-excel));
%stpbegin;
proc print data=sashelp.class;
run;
%stpend;
/**************************************/
So Kindly let me know whether it is supported or not or there is any other alternative
SAS Super FREQ
Posts: 8,864

Re: Problem while exporting the output to excel

Posted in reply to deleted_user
Hi:
The APPSRV_HEADER function was designed for use with SAS/IntrNet. The STPSRV_HEADER function is the one to use for stored processes. I have never used a %LET statement and %SYSFUNC to change the value of the the content-type header, so I can't comment on whether that is appropriate or not.

The only thing I can tell you is that if you use the tagsets.ExcelXP destination, you are creating a stored process that can only be executed in/from a limited number of client applications. You can execute this SP from the Portal, from the Stored Process Web Application (via URL). You could execute this from a custom front end -- JSP or whatever.

You MAY be able to execute this SP from within EG; however you will NOT be able to execute this SP from within the SAS/Addin for Microsoft Office. Word only "accepts" HTML, RTF or SASReport XML results from a SP; Excel only "accepts" HTML, CSV or SASReport XML results from an SP; and PPT only "accepts" SASReport XML from an SP.

There have been several examples of using STPSRV_HEADER with stored processes that have already been posted to this forum. You should be able to find them with a search on STPSRV_HEADER in the forum search box.

cynthia
Ask a Question
Discussion stats
  • 1 reply
  • 177 views
  • 0 likes
  • 2 in conversation