BookmarkSubscribeRSS Feed
webminer
Fluorite | Level 6
Hi,

I've a Stored process web app which will ultimately run in the Info. Delivery Portal. It displays some streaming HTML into the browser then sends (diverts?) the streaming output to Excel (using the HTTP header functions.) The initial stored process does some data manipulation/selection and then displays a button (FORM/INPUT) which, when clicked, calls a second stored process to write the Excel stream.

When the Excel file is written I am left with an orphaned browser (the output from the first stored process) which I'd like to close automagically. (I tried using the onclick event and the window.close javascript functions and they closed the browser WITHOUT running the second stored process to create the Excel output.) Any suggestions or direction would be much appreciated.

Thanks.
2 REPLIES 2
milts
Pyrite | Level 9
Hi

Where did you place the javascript of window.close? If it's on your first stored process then you won't be able to get to the second one.

Try to stream an html with a window.close onload after writing to excel on your second stored process.

Hope this helps.

Milton
webminer
Fluorite | Level 6
Hi,

Thanks for the reply. Yeah, I tried the window.close in the calling stored process and it did what you thought. (ie. closed the window before the stored process was called!) I am now trying as follows:

(2nd stored process)


data _null_;

rc = stpsrv_header('Content-type','application/vnd.ms-excel');

rc = stpsrv_header('Content-disposition','attachment;

filename=Temporary_Excel.xls');

run;



ods tagsets.excelxp body=_webout style=minimal;



proc print etc;

run;



ods tagsets.excelxp close;




ods html body = _webout text="<a id=""Test"" onclick=""window.close();"">End</a>";




data _null_;

put ;

run;



ods html close;



When I call this stored process in debug mode I get the excel output in HTML and see the link ok which works as expected. HOWEVER, in normal execution I get the streaming output into Excel but no browser is displayed at all.

Any additional suggestions gratefully received ....

Thanks.

Message was edited by: webminer

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 871 views
  • 0 likes
  • 2 in conversation