05-09-2014 04:29 AM
Can you please help me in sharing the code to get a download button after generating the ods output of a SAS report (format in Excel) in SAS 9.3.
Rather than viewing the file you will also get a download option to download the output file in SAS 9.3.
Kindly find the attached image where i am getting a download button and after clicking the hyperlink,i get the option to save the output file in Excel in my local computer.
I have written the code in SAS 9.1 but the same code is not working in SAS 9.3.So please guide me how to update the same in SAS 9.3.
Please let me know if you required any further details form me.
05-09-2014 05:00 AM
Would you kindly provide the code?
I don't really find where your problem is.
- Does the code that worked in 9.1 crash in 9.3?
- do you get the button in 9.1 but not in 9.3?
05-13-2014 02:49 AM
I could able to use the code in 9.3 to get the download button,but the issue is I couldn't able to download the file in excel format,By default its in csv format.
Kindly find the below code for your reference and help me in changing the default format as Excel.
ods html style =mystyle;
put '<table border="1" width="100" bordercolorlight=#BBBBBB cellspacing="0" cellpadding="0">';
put ' <tr>';
put ' <td width="100%" bgcolor="#CCFFFF" align="center">';
put " <a href='&CSV' target='_blank'><font size='2' color='black'>Download</font></a><br>";
put ' </tr>';
put '<!--END OF EDIT-->';
filename csvout catalog "&_tmpcat..document.csv";
05-13-2014 04:26 AM
So it seems the file is created as .csv in another part of the program, you need to look there.
05-13-2014 05:19 AM
Why not save the table as excel table using the webpage data.
Instruct your user to move the mouse to the table at the webpage and other mouse button and "export to excel" For small tables very workable.
Downloading a file is possible when:
1/ you have stored that in a dataset accessible by a webserver so you can make a hyperlink (http://... / to that
2/ using the WebDAV protocol that can access the data.
You have stored you csv in a SAS catalog. Yes that is possible like also sas-sources log list and much more. It is easy to offer it cross-platform with RLS.
The issue is a SAS catalog is only readable with SAS tooling.
Uploading files is documented at: SAS(R) 9.3 Stored Processes: Developer's Guide . you can upload to catalogs.
The other way around I have not found/seen, but remember this thread https://communities.sas.com/message/203921
Nikola Markovic did a nice approach. I think you need some adjustments but the idea is good.