Focal Point
[SOLVED]populate portal reports with variable values before first run of reports

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/9507016386

August 27, 2016, 02:12 PM
MG
[SOLVED]populate portal reports with variable values before first run of reports
Hi All,
I have a portal that contains multiple tabs with multiple reports on each tab, the banner contains a html page with the variables for all the reports, two calendar controls and a list of location values.
I have the calendar controls populating with the default values I want to use, the first day of the current month and today, so far so good. My issue is that I want to pass these values to all of the reports when the portal opens and the reports run, I know that multiple parts of the portal run at the same time but surely there is a way to send the parameter values to the reports on the initial load.

I am brand new to js but here is what I have put together so far:


if(typeof(bRuntime) != 'undefined') {
// TODO: Add your inline runtime code here
}
//Begin function window_onload
function window_onload() {
UpdateData();
newdate_start();
// TODO: Add your event handler code here
//add onInitialUpdate() function to make changes before initial run of the reports
//Begin function onInitialUpdate
function onInitialUpdate(){
$(".ui-datepicker").css("font-size","7pt");
button1.click();
}
//End function onInitialUpdate


//Begin function button1_onclick
function button1_onclick(ctrl) {
// TODO: Add your event handler code here
OnExecute(ctrl)
}
//End function button1_onclick


}
function newdate_start() {
var date = new Date();var firstDay = new Date(date.getFullYear(), date.getMonth(), 1);
var startdate = ("0" + (firstDay.getMonth() + 1)).slice(-2) + '/' + (firstDay.getDate()) + '/' + firstDay.getFullYear();
//alert(startdate);
$('#calendar1').val(startdate);
}


Any suggestions would be appreciated.

This message has been edited. Last edited by: MG,


WebFOCUS 8.05
Windows , Excel, PDf, HTML
August 28, 2016, 06:09 PM
Waz
How is the portal calling the reports ?

We used the example in the documentation as a basis for the report calls.

Creating the Refresh Function


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

August 29, 2016, 09:11 AM
MG
Hi Waz,
I just switched to app studio and it uses a tasks and animations tab to call the refresh portal function among other things. I haven't figures out if there is a way to see the code that it is generating yet. In the load task I call the newDate function and then request a refresh of the portal, (all pages).


WebFOCUS 8.05
Windows , Excel, PDf, HTML
September 08, 2016, 02:17 PM
MG
Should anyone else has this issue here is how I solved it.

Set up all my js functions to pick first day of current month as my start date, change the size of the calendar popup to fit in my banner, then I added a new task to refresh the portal after I had gotten the first day of the current month. Only problem is that when the users logon to the portal the reports load, then load again but it's pretty quick so I'm willing to live with it.

Thanks for the help.


WebFOCUS 8.05
Windows , Excel, PDf, HTML