Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Referencing "no input" to prompt

Status
Not open for further replies.

Danielbryanuk

Technical User
Sep 26, 2007
48
DE
Hi all

Using report studio 8.3

I have a prompt page with many prompts, many of which are controlled using hmtl item. Simply put the html ensures one of 3 prompts must be completed before "finish". Thus after selecting an item in prompt 1, if the user selects an item from prompt 2, then prompt 1 is reset to blank. As follows:

<script language="javascript">
//initialisierungsblock
function setDefault(field)
{
var element = "_oLstChoices"+field;
document.forms["formWarpRequest"].elements[element].selectedIndex = 1;

}
function setListener(src, target )
{
var func = function() {
setDefault(target);
if (document.forms["formWarpRequest"].elements["_oLstChoices"+src].selectedIndex > 1){
document.forms["formWarpRequest"].elements["_oLstChoicesMONTH"].disabled = false;
}else{
document.forms["formWarpRequest"].elements["_oLstChoicesMONTH"].disabled = true;
}
}
document.getElementById("_oLstChoices"+src).attachEvent('onchange',func);


}
document.forms["formWarpRequest"].elements["_oLstChoicesMONTH"].disabled = true;
setDefault("GLOBAL");
setListener("GLOBAL","GMT");
setListener("GLOBAL","SUBGMT");
setListener("GLOBAL","SUBMARKET");
setListener("GLOBAL","LOCATIONGROUP");
setListener("GLOBAL","TEAM");
setListener("GLOBAL","CRM1");
setListener("GLOBAL","CRM2");
setListener("GLOBAL","CRM3");
setDefault("GMT");
setListener("GMT","GLOBAL");
setListener("GMT","SUBMARKET");
setListener("GMT","SUBGMT");
setListener("GMT","LOCATIONGROUP");
setListener("GMT","TEAM");
setListener("GMT","CRM1");
setListener("GMT","CRM2");
setListener("GMT","CRM3");
setDefault("SUBGMT");
setListener("SUBGMT","GLOBAL");
setListener("SUBGMT","SUBMARKET");
setListener("SUBGMT","GMT");
setListener("SUBGMT","LOCATIONGROUP");
setListener("SUBGMT","TEAM");
setListener("SUBGMT","CRM1");
setListener("SUBGMT","CRM2");
setListener("SUBGMT","CRM3");
setDefault("SUBMARKET");
setListener("SUBMARKET","GLOBAL");
setListener("SUBMARKET","GMT");
setListener("SUBMARKET","SUBGMT");
setListener("SUBMARKET","LOCATIONGROUP");
setListener("SUBMARKET","TEAM");
setListener("SUBMARKET","CRM1");
setListener("SUBMARKET","CRM2");
setListener("SUBMARKET","CRM3");
setDefault("LOCATIONGROUP");
setListener("LOCATIONGROUP","GLOBAL");
setListener("LOCATIONGROUP","GMT");
setListener("LOCATIONGROUP","SUBGMT");
setListener("LOCATIONGROUP","SUBMARKET");
setListener("LOCATIONGROUP","TEAM");
setListener("LOCATIONGROUP","CRM1");
setListener("LOCATIONGROUP","CRM2");
setListener("LOCATIONGROUP","CRM3");
setDefault("TEAM");
setListener("TEAM","GLOBAL");
setListener("TEAM","GMT");
setListener("TEAM","SUBGMT");
setListener("TEAM","SUBMARKET");
setListener("TEAM","LOCATIONGROUP");
setListener("TEAM","CRM1");
setListener("TEAM","CRM2");
setListener("TEAM","CRM3");
setDefault("CRM1");
setListener("CRM1","GLOBAL");
setListener("CRM1","GMT");
setListener("CRM1","SUBGMT");
setListener("CRM1","SUBMARKET");
setListener("CRM1","LOCATIONGROUP");
setListener("CRM1","TEAM");
setListener("CRM1","CRM2");
setListener("CRM1","CRM3");
setDefault("CRM2");
setListener("CRM2","GLOBAL");
setListener("CRM2","GMT");
setListener("CRM2","SUBGMT");
setListener("CRM2","SUBMARKET");
setListener("CRM2","LOCATIONGROUP");
setListener("CRM2","TEAM");
setListener("CRM2","CRM1");
setListener("CRM2","CRM3");
setDefault("CRM3");
setListener("CRM3","GLOBAL");
setListener("CRM3","GMT");
setListener("CRM3","SUBGMT");
setListener("CRM3","SUBMARKET");
setListener("CRM3","LOCATIONGROUP");
setListener("CRM3","TEAM");
setListener("CRM3","CRM1");
setListener("CRM3","CRM2");
setDefault("TYPE");
setDefault("MONTH");

//document.getElementById("_oLstChoicesGMT").attachEvent('onclick',setGlobal);

function setGlobal()
{
setDefault("GLOBAL");
}

</script>

My issue is that I have a calculated data item that references these prompts - using "case when" method I want to select a corresponding data item based upon which prompt has been completed. I have tried using:

"CASE
WHEN ?pCRM1? is null and ?pCRM2? is null
THEN [GMT Product Overview by Asset Class].[Organisation 1.CRM].[3.CRM]

WHEN ?pCRM1? is null and ?pCRM3? is null
THEN [GMT Product Overview by Asset Class].[Organisation 1.CRM].[2.CRM]

WHEN ?pCRM2? is null and ?pCRM3? is null
THEN [GMT Product Overview by Asset Class].[Organisation 1.CRM].[1.CRM]

ELSE NULL
END"

The problem is that using "null" means the query requests an input for the two remaining incomplete parameters.

Can anyone suggest an operator to use in the query, or a different construct? I would like to maintain the html control if possible!

Thanks
Dan



 
Just to clarify having read it again - I want the calculated data item to return the corresponding data item to any one of pCRM1,2 or 3. Only one of the pCRMs will be completed, therefore I need to change the "is null" operator to something that checks whether the prompt has been completed, in order to avoid having to supply values for all 3 pCRMs.

Does this make sense? Can anyone help?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top