COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: actcognosuser on 23 Dec 2009 09:59:23 AM

Title: recall:Javascript not working in batch mode
Post by: actcognosuser on 23 Dec 2009 09:59:23 AM
I'm using this javascript to automatically select the value in the value prompt and autosubmit.
<script type="text/javascript">
function init()
{
var fW = (typeof getFormWarpRequest == "function" ? getFormWarpRequest() : document.forms["formWarpRequest"]);
if (fW)
fW._oLstChoicesFieldName.options[0].selected = true;
canSubmitPrompt();
if (getFormWarpRequest()._oLstChoicesFieldName.length ==1)
{
getFormWarpRequest()._oLstChoicesFieldName.selectedIndex = 0;
// if the report is running from reportStudio or the Portal objects are different
if (getFormWarpRequest().elements["cv.id"].value == "RS")
setTimeout('oCVRS.promptAction(\'finish\')', 100);
else
setTimeout('oCV_NS_.promptAction(\'finish\')', 100);
}

}
init();
</script>


This works fine when i run it from report studio.but it does not work in batch mode.Any suggestions please???I'm also checking if the report is run in batch mode in the else condition.(('oCV_NS_.promptAction(\'finish\')
Title: Re: recall:Javascript not working in batch mode
Post by: MFGF on 23 Dec 2009 10:55:55 AM
Hi,

For auto-assigning values to prompts in reports run in Batch mode, simple edit the properties of the report in Cognos Connection, go to the Report tab, and use the "Set" link to define the prompt values.

Hope that helps!

MF.
Title: Re: recall:Javascript not working in batch mode
Post by: actcognosuser on 23 Dec 2009 11:51:44 AM
Hi Mf,
             The set properties will not work because the value i'm selecting is a date which changes daily.It has to be scheduled to run by itself and pick up the latest date  value in the value prompt and execute.
Title: Re: recall:Javascript not working in batch mode
Post by: MFGF on 23 Dec 2009 12:54:36 PM
Hi,

I don't think you can use javascript for this, then.  Do you have the SDK?

MF.
Title: Re: recall:Javascript not working in batch mode
Post by: actcognosuser on 23 Dec 2009 01:51:50 PM
I do not have SDK.I guess there should be a way to make the report work in batch mode.I guess
javascript object for batch mode is different.(like oCV_NS_.promptAction instead of OCVRS)
Title: Re: recall:Javascript not working in batch mode
Post by: Sreeni P on 24 Dec 2009 05:12:22 AM
Hi....actcognosuser

can u brief and explain the problem as well as the solution ..i'm also looking for the same scenario...from days back
Title: Re: recall:Javascript not working in batch mode
Post by: actcognosuser on 28 Dec 2009 08:20:16 AM
Hi srinivas,
                   I have not found a solution yet.The problem is the script  that I'm using works only in the
interactive mode i.e when i run the report from report studio.When I try to schedule it to run daily, it displays the prompt page and does nothing.It is supposed to automatically choose the latest date and run the report .
Title: Re: recall:Javascript not working in batch mode
Post by: kulkarni on 30 Dec 2009 08:13:17 AM
8.2/3/4?

Is this the only prompt you have?  Looking at your JS, I understand that you have a Value prompt.  I believe there is a query that drives the display/use values in the prompt. Since you mentioned "it needs to pick the latest date" I assume you want to select the first value in the value prompt.  Is my understanding correct?  If so, can you not skip using JS, instead put a filter in your query that dynamically calculates the latest date?

Quote from: actcognosuser on 28 Dec 2009 08:20:16 AM
Hi srinivas,
                   I have not found a solution yet.The problem is the script  that I'm using works only in the
interactive mode i.e when i run the report from report studio.When I try to schedule it to run daily, it displays the prompt page and does nothing.It is supposed to automatically choose the latest date and run the report .
Title: Re: recall:Javascript not working in batch mode
Post by: actcognosuser on 30 Dec 2009 09:33:50 AM
Thanks for ur reply Srinivas.

Could you please list the steps to select date dynamically in the query?i just have one value
prompt that drives all the queries.Do i have to create a variable?