COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: Steve on 23 Feb 2011 04:54:41 PM

Title: Increase width of Select & Search Prompt
Post by: Steve on 23 Feb 2011 04:54:41 PM
For a Select & Search prompt, is it possible to increase the width? I don't see the size and width property. I tried this in an HTML item but didn't work:

<script type="text/javascript">
<selectValue parameter="pAgency" refQuery="pqAgency" multiSelect="false" required="true">
<useItem refDataItem="Agency"/><style><CSS value="width:700px"/></style></selectValue>
</script>

Can we increase the width of the Prompt?

Thanks !
Title: Re: Increase width of Select & Search Prompt
Post by: Shailaja0520 on 24 Feb 2011 02:06:25 AM
Just try this..worked in 8.2 version

<script>
v = document.forms["formWarpRequest"].elements["_sws_<parameter name>_selectChoices<prompt name>"];
v.style.width=500;
</script>

or if you want a permanent solution-

get the properties.js file located in ..\c8\webcontent\prompting

Set
var SYSTEMPROPERTY_CSEARCH_AUTO_RESIZE_RESULT_LIST = true;

it will dynamically resize the prompt.
Title: Re: Increase width of Select & Search Prompt
Post by: cognostechie on 24 Feb 2011 05:16:45 PM
You can also try this:

1- Put two HTML items around the prompt (The Prompt should be between these two HTML items)

1st HTML - <DIV id="myTextBoxPrompt">

2nd HTML - </DIV>

3- Put another 'HTML' item after 'Finish' button on the prompt page

4- copy and paste folowing javascript( within <script> </script> tags inculding these tags):

<script>
function getObject(obj, type)
{
// step through all child elements of obj and look for an id that starts with 'type':

for (var i = 0; i < obj.all.length; i ++)
{

if (obj.all !=null && obj.all.id != null) {
if ( obj.all.id.indexOf(type) !=-1)
{
return obj.all.id;
}
}
}
}

// making choice box wider
var myDiv = document.getElementById("myTextBoxPrompt");
var div = myDiv.firstChild;
var selectNode = getObject(div,"PRMT_SV_N");
var mySelectNode = document.getElementById(selectNode);
mySelectNode.style.width='500';

</script>
Title: Re: Increase width of Select & Search Prompt
Post by: Steve on 25 Feb 2011 01:27:01 PM
Suhan - Thanks for the suggestion. I am on 8.4 and both of them didn't work. Maybe the versioning issue !

Cognostechie - That worked. Thanks !
Title: Re: Increase width of Select & Search Prompt
Post by: Shailaja0520 on 08 Mar 2011 10:20:36 PM
get the properties.js file located in ..\c8\webcontent\prompting

Set
var SYSTEMPROPERTY_CSEARCH_AUTO_RESIZE_RESULT_LIST = true;

it will dynamically resize the prompt.

This is working in 8.4
Title: Re: Increase width of Select & Search Prompt
Post by: igorcom93 on 05 Aug 2015 02:23:41 AM
Good day,
Could you kindly advise how to solve the following problem.
I have value prompt and I need to use property Size and Overflow (130x30). It its important because the report layout should be static.
But at the same time I want to make my drop-down list wider. I have the values which are cut. It is an issue.
I have used the previous javascript. But it changes the layout (value prompt becomes wider too but i want only drop-down list does)