BookmarkSubscribeRSS Feed
TedP
Obsidian | Level 7

I'd like to execute a stored process immediately when a SAS VA report is first loaded.

 

My current workaround is to simply have a stored process embedded in the VA report and making its container as small as possible, but it would be cleaner if the report was able to envoke the stored process upon load.

 

Thanks,

Ted

4 REPLIES 4
TedP
Obsidian | Level 7

I found an even better workaround. I put the stored process at the bottom of the SAS VA report and then used jquery to remove the element and had the original div it was contained in fill its parent height.

TriciaAanderud
Lapis Lazuli | Level 10

This sounds interesting ... could you share your code?


Tricia Aanderud

Twitter: @taanderud - Follow me!

TedP
Obsidian | Level 7

 

<head>	    
	<script src="scripts/jquery.min.js"></script>
</head>
<body>
<script> 
    $(document).ready(function(){
        var $stp_div=$(".stpFrame", window.parent.document)
				            .filter(function(){ return  $(this).children().length=== 0;}).parents().eq(1);
        var $stp_div_parent = $stp_div.next();
        $stp_div.hide();
        $stp_div_parent.css({"height":"100%"});
});
</script>
</body>

 

 

I am not a web developer by any means but this should work. I had to inspect the html to find the correct class name for the stored process frame. The tricky part was looking outside the current stored process frame with window.parent.document. After finding the element, just hide it, get the last element above it and fill the rest of the page with it.

 

This thread  helped me put jquery in the right place on the server to have access to it.

TriciaAanderud
Lapis Lazuli | Level 10

I'll have to give it a try after SGF.  I've been playing with STPs in VA  ... testing the limits and seeing how to make things work better than expected.  🙂

 


Tricia Aanderud

Twitter: @taanderud - Follow me!

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!

Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 1157 views
  • 2 likes
  • 2 in conversation