The SAS Output Delivery System and reporting techniques

Need help with ODS _webout ( .xls file)

Reply
N/A
Posts: 0

Need help with ODS _webout ( .xls file)

Hi,
I have a dataset "aaa"

ID Vi Name
101 1 XXXXXX
101 2 XXXXXX
102 1 YYYYY
102 2 YYYYY
103 1 ZZZZZZ
103 2 ZZZZZZ

I use the following code for getting this data into Excel .And the output file looks good with both the proc's being separated well in the excel.

OPTIONS orientation=landscape ;
ODS LISTING CLOSE;
ODS HTML FILE='E:\Test.xls' style=sasweb;run;
footnote h=10pt f=TimesRoman j=l "%sysfunc(today(),mmddyy10.)";
options nodate center;
proc print DATA=aaa(where=( VI_=1));
title 'Data with V1';
run;

proc print DATA=aaa(where =(VI_=2)) ;
title 'Data with V2';
run;
ods HTML close;

Now my goal is do something similar using _webout and generate .xls file on the web.

I normally use the code below in my ODS statement if I had to generate reports for end users on the web.

ods pdf body=_webout style=sasweb;

proc print data=aaa noobs label ;
TITLE underlin=1 color=Red justify=center" My Report";
footnote ' ';
run;
ods PDF CLOSE;

But since I'm adding more variables now the end users wanted to have the report in excel.


Appreciate you help.

Regards,
Addy
SAS Super FREQ
Posts: 8,868

Re: Need help with ODS _webout ( .xls file)

Posted in reply to deleted_user
Hi:
Are you using SAS/IntrNet or a stored process? Basically, when you use _webout, you are using a pipeline that exists between a server and a client browser. That pipeline "knows" when you send regular content types like HTML and in some instances, TXT files or PDF files to the browser. And the browser "knows" how to deal with regular content types like HTML, TXT or PDF.

However with either SAS/IntrNet Application Dispatcher programs or Stored Processes, if you are sending non-HTML or you want to launch an application OTHER THAN the browser for rendering the file, you must send a content-type header down the pipeline, so the browser knows to launch a helper program for rendering.

In your instance, if you are generating ODS HTML, but you want Excel to launch instead of the browser, then you have to control the content-type header by using either the APPSRV_HEADER function (SAS/IntrNet) or the STPSRV_HEADER function (Stored Process).

An example of using APPSRV_HEADER can be found here:
http://support.sas.com/kb/23/650.html

and STPSRV_HEADER #6 here:
http://support.sas.com/kb/12/994.html

cynthia
N/A
Posts: 0

Re: Need help with ODS _webout ( .xls file)

Posted in reply to Cynthia_sas
Neat Explanation. My code is now working.

Thanks..

Appreciate your Help.

Regards,
Eddie
Ask a Question
Discussion stats
  • 2 replies
  • 226 views
  • 0 likes
  • 2 in conversation