COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: chr.93 on 05 Mar 2021 03:58:25 PM

Title: Horizontal CheckBox prompt
Post by: chr.93 on 05 Mar 2021 03:58:25 PM
Hello all!

I have a value prompt in checkbox UI and i want to display the values horizontally instead of vertical. I have tried various javascripts, but since I am not an expert at all in javascript, I haven't been able to make it work! :(
Can anyone guide me step by step in how to achieve something like that? I have Cognos 11.1.7!

Thank you  ;D ;D
Title: Re: Horizontal CheckBox prompt
Post by: oscarca on 08 Mar 2021 01:17:25 AM
If you know how Custom controls are implemented you can use this guide from PMSQUARE:
https://pmsquare.com/analytics-blog/2019/1/7/custom-javascript-in-cognos-modifying-prompts
Title: Re: Horizontal CheckBox prompt
Post by: rockytopmark on 09 Mar 2021 09:02:59 AM
CognosPaul latest implementation:

It involves:

-> Name the block (you can name whatever you want but make sure you use same name in HTML item doing the styling):
inlineRadio

-> HTML item code:
<style>
[lid*="inlineRadio"] div{
    height: inherit !important;
    min-height: inherit !important;
    display: flex ;
    width: 100% !important;
    position: inherit !important;
    border: none;
    margin: 0px !important;
}
</style>

move your prompt into the block.

HTH
Title: Re: Horizontal CheckBox prompt
Post by: chr.93 on 14 Apr 2021 01:34:51 PM
Quote from: rockytopmark on 09 Mar 2021 09:02:59 AM
CognosPaul latest implementation:

It involves:

  • Inserting the prompt control into a block
  • inserting an HTML Item in the report that will style the control/block

-> Name the block (you can name whatever you want but make sure you use same name in HTML item doing the styling):
inlineRadio

-> HTML item code:
<style>
[lid*="inlineRadio"] div{
    height: inherit !important;
    min-height: inherit !important;
    display: flex ;
    width: 100% !important;
    position: inherit !important;
    border: none;
    margin: 0px !important;
}
</style>

move your prompt into the block.

HTH

Thank you! that worked perfect!
Title: Re: Horizontal CheckBox prompt
Post by: chr.93 on 14 Apr 2021 01:53:23 PM
Quote from: rockytopmark on 09 Mar 2021 09:02:59 AM
CognosPaul latest implementation:

It involves:

  • Inserting the prompt control into a block
  • inserting an HTML Item in the report that will style the control/block

-> Name the block (you can name whatever you want but make sure you use same name in HTML item doing the styling):
inlineRadio

-> HTML item code:
<style>
[lid*="inlineRadio"] div{
    height: inherit !important;
    min-height: inherit !important;
    display: flex ;
    width: 100% !important;
    position: inherit !important;
    border: none;
    margin: 0px !important;
}
</style>

move your prompt into the block.

HTH

Actually that work with Radio Button UI. When multiselect, in checkbox UI, it doesn't seems to works. Should I change something in the code? Also if i have many selections inside the box,how can i make the change line? Thank you again for your help!