If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

recall:Javascript not working in batch mode

Started by actcognosuser, 23 Dec 2009 09:59:23 AM

Previous topic - Next topic

actcognosuser

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\')

MFGF

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.
Meep!

actcognosuser

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.

MFGF

Hi,

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

MF.
Meep!

actcognosuser

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)

Sreeni P

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

actcognosuser

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 .

kulkarni

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 .

actcognosuser

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?