COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Revathi_M on 29 Oct 2014 07:02:29 AM

Title: radio button How to change vertically to Horizantly
Post by: Revathi_M on 29 Oct 2014 07:02:29 AM
Any body export help me

radio button How to change vertically to Horizantly
Title: Re: radio button How to change vertically to Horizantly
Post by: BigChris on 29 Oct 2014 07:35:04 AM
Could you elaborate please?
Title: Re: radio button How to change vertically to Horizantly
Post by: Revathi_M on 29 Oct 2014 09:28:23 AM
Hi bigchris,

when i run report the radiobutton output like display:
.A
.B
.C

but i want when run the report Display like .A .B .C
Title: Re: radio button How to change vertically to Horizantly
Post by: CognosAnalytics on 29 Oct 2014 12:04:19 PM
Hello Revathi_M,
There is no stright forward out-of-the-box way of doing this. But, can be done using Javascript/HTML items.

-Cognos810
Title: Re: radio button How to change vertically to Horizantly
Post by: CognosAnalytics on 30 Oct 2014 01:38:57 PM
Here you go:

Simply add two HTML items on the left and right of your radio button.
On the left of the radio button prompt, HTML item should have: <div id="radioDiv">
and on the right side the HTML item should have </div>

Then create another HTML item and paste the below code in it.

<script type="text/javascript">   
function inlineRadios(child)
{

if((child.type == "radio")||(child.type == "checkbox"))
{
child.parentNode.parentNode.style.display="inline";
child.parentNode.parentNode.style.whiteSpace="noWrap";
}
}   

function promptDescendants (node)
{

for (var i = 0; i < node.childNodes.length; i++)
{
var child = node.childNodes;
inlineRadios(child);
promptDescendants(child);
}
}
var theDiv = document.getElementById("radioDiv");
promptDescendants(theDiv);
</script>