BookmarkSubscribeRSS Feed
TedP
Obsidian | Level 7

I have a table I created from a stored process that outputs to html via ods. Attached to the html are two buttons (one for downloading the table as pdf and the other excel).

 

I am looking for a way to query the data once and somehow save the pdf/excel output until the user clicks the pdf/excel button. My current solution is to query the data twice - once on page load to show the HTML table and again in a separate stored process when the user clicks the pdf/excel button.

 

Basically I want to generate the pdf and excel downloadable documents on initial page load but don't give them to the user until button click.

 

Here is some pseudo code using some jquery.

 

proc sql;
    some query
quit;

ods html body=_webout ;

ods html text="<script>
					$('#printPDF').click(function(){
                                           Requery data in a separate stored process
					});

                                       $('#printExcel').click(function(){
                                           Requery data in a separate stored process
					});
				 </script>
			<button id='printPDF'>Print PDF</button>
	 		<button id='printExcel'>Print Excel</button>";

/* output html table */
proc report 
	data=mydata;
run;

 

2 REPLIES 2

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 972 views
  • 0 likes
  • 3 in conversation