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

multiple prompts in main page of the report

Started by cognoise007, 25 Mar 2008 12:17:48 PM

Previous topic - Next topic

cognoise007

Hi gurus
  I am in need to create a report as follows
In a single page two list reports and this two list reports should work according the prompt we select.
The prompt should be present in the same main page and all the four prompts are not related to one another,but after selecting all the four prompts only the reports should run according to the prompt selection and
there should not be any submit button for this.

can i know how we can accomlish this task

Thanks in advance

jamesqi

You can use conditional block and variables to do this report. Create a prompt page first, then put the lists to conditional block. Set block varible.
Hope this helps.
James

almeids

With 'no submit button' as a requirement your functionality will be limited.  Your prompts will all need to be single-select.  They'll all need to be required if you don't want the report to run without them all set, and will all need default values if you don't want Cognos generating a default prompt page when you run.
After its initial display, the report will refresh with each prompt change (no wait for all 4), which may be what you want, but if it isn't you'll need Javascript to keep track of things (maybe - I'm not even sure that will do it and it may seriously complicate things for you if it's possible).  If you do want reselection of multiple prompts you should seriously consider a Finish button IMHO.

jamesqi

I shouldn't create prompt page because you want the prompts in the same main page.

Sunchaser

Hello,

I made a short test based on 4 lisbox in the same prompt page.
The idea is to put a javascript in some HTML Items, and catch the 'OnChange' events of the listbox in order to check in all these objects if something has been selected or not ( and If we have our 4 selection at least, submit the report).
So you will need 5 HTML Items, one containing the 'general function' that has to be put at the beginning of the page, and 4 HTML Items (one for each listbox) that should be put after each listbox concerned by the code inside.
(the property 'name' of each listBox have been set to lstJS1, lstJS2, lstJS3, lstJS4)

HTML Item1:

<script text=javascript>
function mCheck2()
{
var Lbox;
var n_count = 0;
<!--List1-->
Lbox = document.forms["formWarpRequest"].elements["_oLstChoiceslstJS1"];
for (var i = 0; i < Lbox.length; i++)
{
if (Lbox[i].selected)
{
n_count++;
break;
}
}
<!--List2-->
Lbox = document.forms["formWarpRequest"].elements["_oLstChoiceslstJS2"];
for (var i = 0; i < Lbox.length; i++)
{
if (Lbox[i].selected)
{
n_count++;
break;
}
}
<!--List3-->
Lbox = document.forms["formWarpRequest"].elements["_oLstChoiceslstJS3"];
for (var i = 0; i < Lbox.length; i++)
{
if (Lbox[i].selected)
{
n_count++;
break;
}
}
<!--List4-->
Lbox = document.forms["formWarpRequest"].elements["_oLstChoiceslstJS4"];
for (var i = 0; i < Lbox.length; i++)
{
if (Lbox[i].selected)
{
n_count++;
break;
}
}
<!--Result-->
if (n_count > 3)
{
promptButtonFinish();
}
}
</script>


HTML Item 2 to 5 (one for each listBox):

<script text=javascript>
var Lbox1 = document.forms["formWarpRequest"].elements["_oLstChoiceslstJS1"];
var event_att = Lbox1.attachEvent("onchange", mCheck2);
</script>
//----------------
//and so on for each items:
<script text=javascript>
var Lbox2 = document.forms["formWarpRequest"].elements["_oLstChoiceslstJS2"];
var event_att = Lbox2.attachEvent("onchange", mCheck2);
//etc, etc, etc
</script>


It is not surely a very 'clean' code (in fact I'm a little bit newbie with Javascript), but I think It could be the beginning of a solution.

Hope it could help you,
++
;)