Data visualization with SAS programming

Link to two Locations Inside of Stored Process

Accepted Solution Solved
Reply
Super Contributor
Posts: 465
Accepted Solution

Link to two Locations Inside of Stored Process

Inside of Information Delivery Portal via a Web URL Portlet.  I’m running into a problem where one of my forms has a Refresh button and a View All button.  The Refresh button reloads the same page based on a dropdown selection.  The View All button takes the user to another page and should pass the parameter of the updated dropdown, however the user has to hit the refresh button to update the parameter.  The reason is that the dropdown only saves its value on post back.  The original author of the page used one form object per button.  I think I could solve the issue using one form and buttons that have syntax like.

PUT "<button onclick=""window.location.href=""https://serverName/"@;

PUT "SASPortal/Director?_directive="@;

PUT "STPRun&_action=execute%nrstr(&_program)=/Reports/Research Dashboard/Monthly Expense Report"@;

PUT "%nrstr(&save_REPORT_MONTH=)&save_REPORT_MONTH""""/>View All Reports</button>";

Oddly this syntax calls the second page without the updated dropdown value.  All of the documentation I am looking at for standard HTML states this should work.  Am I missing something obvious here?  Is there a simpler way to do this?


Accepted Solutions
Solution
‎09-25-2015 06:23 AM
Super Contributor
Posts: 465

Re: Link to two Locations Inside of Stored Process

Added to Dropdowns:

onchange='this.form.submit()

 

If you did need to redirect for some reason _action=execute skips the parameters.

View solution in original post


All Replies
Super Contributor
Posts: 465

Re: Link to two Locations Inside of Stored Process

I’m looking at redirect options.  Once I figure this out I’ll add logic to reload the page and do this under a condition if a button is pressed.  It seems the redirect syntax is slight different when using SAS.

 

%macro javaScriptFunctions;
data _null_ ;
file _webout ;
put 'script type="text/JavaScript"' ;

put "function viewAll() {";
put "var newPage = window.location.href + ""servername/"@;
put "SASPortal/Director?_directive=STPRun&_action=execute&_program=/Reports/Research Dashboard/Monthly Expense Report"@;
put "&ACCOUNT_INDEX=ALL&save_REPORT_YEAR=2015&save_REPORT_MONTH=5"";";
put "window.location.replace(newPage);";
put "}";
put "</script>";
run ;
%mend;
%javaScriptFunctions;

 

this results in parameter error

Invalid _action value: execute/Reports/reportName=/Reports/reportName2.

 

BTW, there is a major bug in the new forum where you can't post HTML.

Super Contributor
Posts: 465

Re: Link to two Locations Inside of Stored Process

After changing my spaces to + I got the error 

Invalid _action value:   one step closer.

 

This article seems relivent.

 

http://support.sas.com/kb/20/154

Super Contributor
Posts: 465

Re: Link to two Locations Inside of Stored Process

I followed the article http://support.sas.com/kb/20/154.html.  I used the same syntax on the redirect I receive a prompt screen filled with the prompts that I sent appended with the & signs.  After I click run my stored process runs.  How do I skip the prompt screen?

Solution
‎09-25-2015 06:23 AM
Super Contributor
Posts: 465

Re: Link to two Locations Inside of Stored Process

Added to Dropdowns:

onchange='this.form.submit()

 

If you did need to redirect for some reason _action=execute skips the parameters.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 438 views
  • 0 likes
  • 1 in conversation