Topic
8 replies Latest Post - ‏2011-02-23T16:34:07Z by SystemAdmin
hauge9
hauge9
277 Posts
ACCEPTED ANSWER

Pinned topic "Yes/No" Checkbox Prompt

‏2009-07-22T21:43:12Z |
I am wondering if anyone knows the best way to accomplish this:

I have a parameter that essentially is a Y/N flag. I am conditionally doing some things in the report if Y is selected.

I would like this to appear on the prompt page as basically just a blank check box. I want the user to be able to just leave it unchecked and treat it as "No" or check it and treat it as "Yes"
Any ideas?

Currently I just have 2 radio buttons with "Yes" and "No" as the options...but this gets cumbersome.
Updated on 2011-02-23T16:34:07Z at 2011-02-23T16:34:07Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    15496 Posts
    ACCEPTED ANSWER

    Re: "Yes/No" Checkbox Prompt

    ‏2009-07-23T13:26:24Z  in response to hauge9
    I believe the definition of a checkbox is 'multi-select' and a radio button is 'single-select' so I can't think of a way to use a checkbox for Y/N. If you default the radio button to 'No' why is it cumbersome to use?
    • hauge9
      hauge9
      277 Posts
      ACCEPTED ANSWER

      Re: "Yes/No" Checkbox Prompt

      ‏2009-07-23T15:55:15Z  in response to SystemAdmin
      Well, it's a fine workaround. By cumbersome I just meant it takes up more space on the prompt page.

      I've just had specific requests from multiple users to have a check-box prompt. But I'm doing the radio buttons for now.

      I tried to do a multi-select with "Y" being the only option. Just didn't work out too well.
      • SystemAdmin
        SystemAdmin
        15496 Posts
        ACCEPTED ANSWER

        Re: "Yes/No" Checkbox Prompt

        ‏2011-02-23T16:34:07Z  in response to hauge9
        Hi,
        If the extra space is the only problem, I would just resize the radio button. You can re-size it using the size and overflow properties. Check the attached screen print. I have re-sized it to 1.5 cm wide. Also, explain the users about the complexity involved here as explained by other folks here.

        However, if your users are too adamant about having two small checboxes for Yes and No. Then, the only option I can think of is:

        Have two separate parameters for Yes and No. Create Two checkboxes. Each with only one static value.
        Write a Java script which will throw alert message to users if both values are selected and ask them to clear off one of them.

        Again, I wouldn't recommend javascript unless the functionality is absolutely critical considering IBMs disclaimer towards usage of 3rd party tools/programs and other upgrade issues.

        Hope that helps.

        GiCY
  • dtremain
    dtremain
    455 Posts
    ACCEPTED ANSWER

    Re: "Yes/No" Checkbox Prompt

    ‏2009-07-23T17:13:56Z  in response to hauge9
    I'm not clear on your question. From what I understand, I'd use a checkbox with a title / description that is a yes/no question or enable/disable or some such. E.g. X Show Extra Features
    I'd set the default for it to be yes/no, depending on what you want.
    I'd use the value of the prompt to set a variable, and then use that variable to control the conditional behavior in the report.
    Radio buttons are, by definition, a group - the value of a radio prompt control is the selected radio button. So, if you want to use radio buttons, I'd have two - one for Yes, and one for No. Again, I'd set a default, and then use the value of the radio button prompt to set a variable, and then use the variable to control the conditional behavior in the report.
    The reason I'd use a variable is because conditional render / conditional format requires a variable. If your conditional behavior does not depend on those, but just on how things are calculated, for example, you could use the prompt value directly in a CASE of IF THEN statement in your calculated item(s).
    • hauge9
      hauge9
      277 Posts
      ACCEPTED ANSWER

      Re: "Yes/No" Checkbox Prompt

      ‏2009-07-23T17:33:22Z  in response to dtremain
      Yes, what I'm doing now is a radio button with Yes and No as the options and defaulting to no. This works fine.

      I was just looking for a way to actually just have 1 check box instead of this. It would either be checked or unchecked.

      I realize the first option accomplishes the same thing. The 2nd option is just something users have requested and takes up less space on the screen.

      Not a terrible workaround. Just figure it was worth seeing if it's possible or can be ruled out.

      Thanks.
      • SystemAdmin
        SystemAdmin
        15496 Posts
        ACCEPTED ANSWER

        Re: "Yes/No" Checkbox Prompt

        ‏2009-07-23T17:36:40Z  in response to hauge9
        I tried it again and it's true that the checkbox is only a multi-select option so a person could conceivably choose both Yes and No. I tried to think of other - smaller - options (like 2 little checkboxes with one option each) but I couldn't find anything that would prevent the user from choosing more than one choice.

        I don't think this can be done out-of-the-box.
  • dtremain
    dtremain
    455 Posts
    ACCEPTED ANSWER

    Re: "Yes/No" Checkbox Prompt

    ‏2009-07-23T19:18:23Z  in response to hauge9
    Closest I could get was 1 radio button, with a Deselect link under it. Not sure that is much improvement over the two radio button yes/no solution.
    Drop a Value Prompt on the prompt page. In Static Choices, add 1 entry Use = 1 and Display = Use Feature
    Set Rows Per Page to 1
    Set Required to No
    Set Multi-Select to No
    Set Select UI to Radio button group
    Set Default Selections to 0
    Run
    • SystemAdmin
      SystemAdmin
      15496 Posts
      ACCEPTED ANSWER

      Re: "Yes/No" Checkbox Prompt

      ‏2011-02-23T15:03:08Z  in response to dtremain
      Value you want to pass is either that display value you selected for the checkbox prompt or..... set it to "is null"

      That worked for me when I was applying a dynamic title that was to display only the specific check boxes (1 check box per item on the prompt) values.
      Example of what I got to work for my specific needs (for what it's worth):

      If (ParamDisplayValue('ORG') ='value1' and ParamDisplayValue('ORG2') ='value2' and ParamDisplayValue('ORG3') is null) then ('value1 | value2')
      Else
      If (ParamDisplayValue('ORG') ='value1' and ParamDisplayValue('ORG2') ='value2' and ParamDisplayValue('ORG3') ='value3') then ('value1 | value2 | value3')
      Else ('N/A')

      The check box checks to see if the value (the only value for that parameter) is met (YES).

      If it's not, it is essentially NULL and therefore I use that syntax to complete my statement (NO).

      I hope this helps and I wrote it hastily while at work as I figured the sooner I could share and help the better..

      Let me know if that helped?

      Thanks.