Thursday, 4 August 2016

Cognos Report Studio - Horizontal Radio Button

In cognos, radio button options appear one below the other as shown below.

As you know cognos is not having any specific property to turn the vertical radio buttons into horizontal radio button, i.e radio button one beside the other (inline). To achieve this i have used javascript.

1. Go to report studio, drag a value prompt into the report.
2. Create some static choices (Use: 1, Display: Choice 1; Use: 2, Display: Choice 2)
3. Change the 'Select UI' property to 'Radio Button Group'.
Now if you run the report and check, you can see the options of the radio button one below the other.
4. Now drag a HTML item from properties window into the page and paste the below code in that.

<script type="text/javascript">
function horizontal(choices)
{
     if(choices.type == "radio")
     {
        choices.parentNode.parentNode.style.display="inline";
choices.parentNode.parentNode.style.whiteSpace="noWrap";
     }
}
function options(node)
{
for (var i = 0; i < node.childNodes.length; i++)
{
  var choices= node.childNodes[i];
  horizontal(choices);
  options(choices);
}
}
</script>

5. Now drag one HTML item just before the radio button prompt and place the below code in that,

<div id="radio">

6. Drag one more HTML item just after the radio button prompt and place the below code in that,

</div> <script>options(document.getElementById('radio'));</script>

7. Save the report and run it, now you can see the radio buttons one beside the other, as shown below.

Thanks....!

4 comments:

  1. Thanks Very Much, it worked for me

    ReplyDelete
  2. . A Great Chance For Foreigners
    Are you a foreigner and willing to invest or reside in Qatar? You as a property buyer can avail a residency permit if you buy a property in the Pearl which is iconed as the most luxurious residential and commercial area in the Middle East. It is a great chance for foreigners to invest because the population of expats is hitting the milestone which can result in high property demand according to Qatari Labor Law. The expats can buy properties available in the pearl such as Villas, townhouses, Penthouses and luxury apartments.

    key role in helping foreigners to buy a property in Qatar in order to invest or move there due to career develop-ments or societal change.

    To buy a property in Qatar due to investments reasons sounds a good decision. Since Qatar is a tax free country, there is no tax on property nor rental income.
    We at PROPERTY HUNTER shifted this service to a level much higher than the broker concept. Our highly trained and professional experts team will review and evaluate our client's needs and requirements. A customized consultancy option has been developed to respond to each client's needs, needs and capabilities and match them with appropriate opportunities. Property prices in Qatar Evaluate your Property Before pricing and advise about the value of any property, we do in-depth evaluation and market analysis, inspection, in addition to the profes-sional advice from our experienced advisors. you can see more details like this article
    <a href="http://propertyhuntergroup.com/en/real-estate-consulting> Property for sale Development & Investment </a>

    ReplyDelete