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

Date prompt not passing from parent report to child report

Started by chandanrock, 02 Apr 2014 10:53:55 AM

Previous topic - Next topic

chandanrock

I have a scenario where i have a welcome page dashboard report which has only prompts and drill thorugh links to other child reports. I have a requiremment to add 3 static prompts and a from/to date prompt.
The three static prompts are passing to the child report but the date prompt(from and to) do not pass to the child report.
The parameter names in both the reports are same. The filter in the child is "date between Cast(?from? as date) and cast(?to? as date)".
In the source report i have tried passing the parameter value of the two prompts, to the target report and the prompt page in target report still pops up asking fro date values.
I even created a dummy query in source report and created two data items with ?from? and ?to? and tried passing the data item values to the targtet.
But in this case, when i run the report, before the report runs, the two prompts pop up before the the main welcome page dashboard shows up.

Can anyone help me solve the issue.

chandanrock

So guys,
i am able to pass the date parameters to the child report.
The issue was the report was not capturing the dates i selected in the main report and being passed to the child.

The two static prompts i have are set to auto-submit. So when i changed the static prompt selection, the page refreshes and the date is somehow passed.
Now if try changing the date selection, and drill thru, i still see the odl selection. But if i change the static prompts(which refreshed the pageautomatically) the new date i selected is passed.

Is there a way i can refresh the page when i select a new date range?

Thanks

Waydin2296

Quote from: chandanrock on 02 Apr 2014 11:35:52 AM
So guys,
i am able to pass the date parameters to the child report.
The issue was the report was not capturing the dates i selected in the main report and being passed to the child.

The two static prompts i have are set to auto-submit. So when i changed the static prompt selection, the page refreshes and the date is somehow passed.
Now if try changing the date selection, and drill thru, i still see the odl selection. But if i change the static prompts(which refreshed the pageautomatically) the new date i selected is passed.

Is there a way i can refresh the page when i select a new date range?

I believe if you have auto-submit and the required prompts have been filled, your selections are then processed.
Are the dates required or optional?
Also, would it be ok to use a reprompt button? 
This will not leave the page so you will still want a finish button

Another option is to pass the parameters with a URL


chandanrock

Thanks for the replies guys.

Waydin2296 - I found a javascript which will refresh the page when i select the date range prompt. This helped me not use a finish button.

Nimrod - I have not used a lot of JS. I see a lot of solutions for reporting are done using JS. I guess i should start learning some Java.

The java script used is placed on top of the page. i dont know why it works only that particular place, but it serves the purpose.

<script language="javascript">
function func() {
if (getFormWarpRequest().elements["cv.id"].value == "RS")
     setTimeout('oCVRS.promptAction(\'finish\')', 100);
else
    setTimeout('oCV_NS_.promptAction(\'finish\')', 100);
}
</script>
<body  onfocus="func()" >
</body>

Thank you both for your time.

navissar

This will work. However, forgive me if I say it's a terrible solution. This will refresh the page whenever you focus on a prompt.

chandanrock

I tried making all the value prompts auto-submit property set to "NO" and tried running the report. The report does not refresh after i select the any other value prompt. The page refreshes only after i select the date prompt. This is causing the date value selected to pass a parameter value selected to the date range prompt in the target report.


CognosPaul

Chandan, the script Nimrod linked to will allow you to pass prompt values without the need to reprompt your page. This is extremely useful in cases with a date prompt, which doesn't refresh the page upon selection, and in pages that are slow to load.

Which version of Cognos are you using? If it's 10.2 or above, the solution provided will work perfectly. Simply copy/paste it into an HTML item, replace the variable containing the report path, and put the input containing the runReport function wherever you want.

Versions below Cognos 10.2 will need some modification to get it to work right. For example there's no easy way to get all the prompt values from all the prompt controls. It is possible however, and I've already implemented it in one of my client sites. If there's demand, I'll adapt that to work on the samples and upload the report xml.

chandanrock

I would love to give this a shot, but i dont have any knowledge on Javascripting.

We are using cognos 10.1 and if you could provide me a script that i can use, it would be really helpful.

Thanks a lot Paul.

Nimrod, you were correct.
I understood what you were trying to tell me when i ran the report and changed windows and came back to the report window and clicked on the screen, the report refreshed again.

Thanks.
Chandan



chandanrock

i tried the script provided, but when the child report opens, the window does not maximize. I do not see the maximize window option.

chandanrock

Hi CognosPaul,

Were you able to get a solution for Cognos 10.1. The script provided works, but the report output window does not maximise/ rezise.

Thanks
Chandan