Your SAS programs, embedded in web apps and elsewhere

SAS Stored Process Web Application HTML pages to Excel

Reply
Occasional Contributor
Posts: 15

SAS Stored Process Web Application HTML pages to Excel

I've got HTML tables (Proc print, means etc.) generated from SAS batch jobs (Windows Server) that I can right click and select download to Excel and the data exports perfectly!

When I do the same with an HTML table generated from the SSPWA, it gives me an Excel query error and doesn't export the data.

I've compared the (view source) source generated from both methods and they seem identical right down to the number of lines.

Anyone know why I can't download an HTML table to Excel generated from the SSPWA?

Pretty frustrating.

Thank you.

PROC Star
Posts: 1,236

Re: SAS Stored Process Web Application HTML pages to Excel

I'm confused....

1.  When you say you have html files that you can right click and select "download to Excel", what do you mean?  You mean in Windows explorer you can right-click the file and select download to Excel?  Or do you mean in Internet explorer you can view an .html file with a table in it, and right-click the table and select download to Excel? Or something else?

2.  You have two .html files (one produced by your batch job which works as you want, and one produced by SPWA which doesn't work as you want).  If you diff those two files, they are exactly the same?   

Occasional Contributor
Posts: 15

Re: SAS Stored Process Web Application HTML pages to Excel

To clarify, using HTML files (tables) created from sas batch jobs, in Internet Explorer I can RMB and there is an option to download to Excel and it works.

In a HTML file (tables) created from SPWA, in Internet Explorer I can RMB and there is an option to download to Excel and it doesn't work. Same coded used in batch job was converted to a stored proc and executed from SPWA.

Viewing the source code from IE, show they are the same.

Steve

PROC Star
Posts: 1,236

Re: SAS Stored Process Web Application HTML pages to Excel

I googled "Internet Explorer" and "Export to Excel"  (which is the RMB option I have in IE 8) and found plenty of  complaints about this IE feature being buggy:

  http://answers.microsoft.com/en-us/ie/forum/ie9-windows_7/internet-explorer-9-error-export-to-micros...

So would suggest you check the IE support boards for your version of IE, bitness, etc (or try SAS support, as Cynthia suggested).

If the goal is to use SPWA to generate an Excel file (or Excel-like file), you could so that in other ways, e.g. writing results with destination as tagsets.excelxp or something else Excel is happy to open.


Occasional Contributor
Posts: 15

Re: SAS Stored Process Web Application HTML pages to Excel

Thanks Quentin, seems odd that I can without errors export from the SAS batch generated HTML pages always, and not at all when they are generated from SPWA. I'll have to follow-up this issue with SAS TS I guess.

Steve.

PROC Star
Posts: 1,236

Re: SAS Stored Process Web Application HTML pages to Excel

Note that what you are seeing is consistent with the issue described in the link I posted:

When I attempt to use this facility [RMB -> export to Microsoft Excel] from any "http://" sites, the resulting "New Web Query" dialog that is presented by Excel shows an
  Address of http:/// and displays a standard browsing error of "This program cannot display the webpage". However this facility still works fine for any local [html] files that I load directly into the browser.

So my money is on IE bug, not SAS bug.

Note if you follow the thread, it's 2 years of people complaining about this being broken in IE9, followed by one post in 2013 saying it seemed to work for them in IE10.

Please post if you or tech support come up with a solution or definitive diagnosis.  I never knew IE had this feature.  Could be useful, if it can be made to work reliably.

--Q.

SAS Super FREQ
Posts: 8,744

Re: SAS Stored Process Web Application HTML pages to Excel

Hi:

  Sometimes with the SPWA you have to send a content-type header and use the STPSRV_HEADER to make that happen in your program. Like Quentin, however, I don't exactly understand the scenario you are describing. EG would let you RMB and then do a send to Excel, but the SPWA doesn't do that with Stored Process results. It might be better if you worked with Tech Support on this. Working with Stored Processes and the Platform and the SPWA might mean your Stored Process needs some tweaking, which means that someone has to look at ALL your stored process code and output to see why it is (allegedly) behaving differently than the other code and output.

cynthia

Ask a Question
Discussion stats
  • 6 replies
  • 1227 views
  • 0 likes
  • 3 in conversation