I have run in to a slight issue and thought I would toss this out here and see if anyone else has experianced anything like it.
I am prepareing an 8.2 to 8.4 upgrade and use Javascript for several different things in my reports, for the most part I haven't had any issues with the new 8.4 way of doing things.
I used this Knowledge Base article to allow me to Pre-Populate a Date Prompt in 8.2 and it works fine, using the modified 8.3 recommendation these reports still work for me.
http://support.cognos.com/knowledgebase/googlesearch?load_kb_document=1&dr=kb1&uniqueid=140483
For CRN, Cognos 8.1 and cognos 8.2
<script language="javascript">
// Note: This technique uses JavaScript against underlying report objects in a Cognos 8 BI report.
// For this reason, there is no guarantee that reports created using this technique will
// migrate or upgrade successfully to future versions without requiring modifications.
// Any such modifications are the responsibility of the report designer.
if (document.forms["formWarpRequest"].elements["_oLstChoices<fieldname>"].length ==1)
{
document.forms["formWarpRequest"].elements["_oLstChoices<fieldname>"].selectedIndex = 0;
setTimeout('listBox<fieldname>.autoSubmit()', 100); }
</script>
Where <fieldname> is the field name from step 3.
For Cognos 8.3
<script language="javascript">
// Note: This technique uses JavaScript against underlying report objects in a Cognos 8 BI report.
// For this reason, there is no guarantee that reports created using this technique will
// migrate or upgrade successfully to future versions without requiring modifications.
// Any such modifications are the responsibility of the report designer.
if (getFormWarpRequest()._oLstChoices<FieldName>.length ==1)
{
getFormWarpRequest()._oLstChoices<FieldName>.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);
}
</script>Up to this point everything works.
Here is what I am doing.
We have several reports that have the prompts on the data page, to keep the report clean we hide and show these prompts with some additional javascript (which didn't change in 8.3/8.4).
These are ReportStudio Reports built off of a Cognos Cube.
We want to force the value of the "Current Month" into this prompt - the script above does this wonderfully. We have a prompt page that is basically hidden - we have it display "Please wait while your report is being constructed" the Date Parameter is then populated by the script above. Then once the report has refreshed we have a second Date Parameter on this page (using the same Paremeter name) with a default value of the Parameter.
This allows us to have 5 years of history by month in this Prompt but when the report is opened always defaults to the Current Month and gets us away from having to manually hardcode the Member Unique Name each month.
Once again - this works great even in Cognos 8.4
However, one of the reports is used in the Cognos Viewer on a Portal page as our "Dashboard" for the application.
On this portal page the Script to populate the initial prompt is bypassed due to the new prompt features that have been added to the Cognos Viewer in 8.4
My options at this point are:
1 - Go back to hardcoding the Member Unique Name each month for this Dashboard report
2 - Find some way to force the Cognos Viewer in the portals to work the same way the Default Cognos behaves and process this script - as it does in Cognos 8.2
3 - Call out for help and hope someone else working with the new Cognos 8.4 release has found a way around this.
Any feed back on this would be appreciated.