COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: yoursmani on 21 Apr 2009 12:05:43 AM

Title: Is there any way to increase the size of select & search prompt
Post by: yoursmani on 21 Apr 2009 12:05:43 AM
Hi All,

I have a select & search prompt in my prompt page. The values loaded in this prompt are of charecters with more than 100 in length and the values are not visible to full extent.

Is there any way to increase the size of this prompt but i found for other prompts value, text box we have size and overflow property under positioning but not for select & search prompt.

I knew that this can be achived globally by doing changes in toolbar.xml but is it possible to do it in the report studio as my crieteria here is only for 3 reports.

Thanks,
Mani.
Title: Re: Is there any way to increase the size of select & search prompt
Post by: bobj on 22 Apr 2009 07:54:02 AM
Hi,

Try using these steps:

1- Open an empty report with any package ( we will only create prompt page with 'Search and select' prompt)

2- Create a prompt page and put a 'HTML' item , 'Search and Select' prompt and antoher 'HTML' item ( Prompt should be between 2 'HTML' item).

3- Set 'Multiselct' property to 'No' for prompt

4- Open first 'HTML' item an type

<DIV id="myTextBoxPrompt">

5- Open second 'HTML' item and put

</DIV>

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

7- 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: Is there any way to increase the size of select & search prompt
Post by: dumbell on 01 May 2009 12:37:04 PM
A little better version that worked perfectly for me.
Hope this works for you..
Thanks for the initiative bobj..

----

Html items handles of the prompt

1)<DIV id="myTextBoxPrompt">
2)</DIV>

3rd Html item next to last button on the prompt page

<script>
var theDiv = document.getElementById("myTextBoxPrompt");
// find all the children of the DIV
for (i=0; i < theDiv.childNodes.length; i++)
{
// find the select TAG and set the size attribute
var node_list = theDiv.childNodes.getElementsByTagName('SELECT');
for (var j = 0; j < node_list.length; j++)
{
node_list[j].style.width='auto';
node_list[j].style.height='auto';
}
}
</script>
------
Title: Re: Is there any way to increase the size of select & search prompt
Post by: kado on 22 May 2009 12:39:53 PM
Would the JS look different for 8.4? I tried adding the 3 HTML items mentioned above and didn't notice a difference at all.

-thanks-
Title: Re: Is there any way to increase the size of select & search prompt
Post by: dumbell on 25 May 2009 10:31:09 PM
It works in 8.3 though.

Dumbell
Title: Re: Is there any way to increase the size of select & search prompt
Post by: rockytopmark on 30 Jun 2010 02:07:11 PM
Change (or add) the last 3 lines to the script to also change the width of the "selected" box on the right of the control:

//selected box (rightside) sizing
var selectNode = getObject(div,"PRMT_LIST_BOX_SELECT_N");
var mySelectNode = document.getElementById(selectNode);
mySelectNode.style.width='300';
Title: Re: Is there any way to increase the size of select & search prompt
Post by: tupac_rd on 30 Jun 2010 03:31:38 PM
for folks who are not javascript proficient   ;)

http://www-01.ibm.com/support/docview.wss?rs=3442&context=SS9RTN&q1=%2bprompt+%2bresize&uid=swg21341018&loc=en_US&cs=utf-8&cc=us&lang=all