02-17-2014 05:48 PM
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?
02-17-2014 07:47 PM
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?
02-18-2014 10:25 AM
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.
02-18-2014 03:27 PM
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:
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.
02-18-2014 04:30 PM
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.
02-18-2014 07:59 PM
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.
02-17-2014 11:06 PM
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.