Default Parameter CheckBox Selection when Checkbox is a connected parameter

(10 posts) (2 voices)
  1. cris, Member

    I have a connected checkbox parameter that relies on a previous select list to limit the choices:

    SELECT DISTINCT c.CID, c.CName
    FROM smi.crp c
    WHERE c.GID = mydbr_param_prev1
    ORDER BY c.CName;

    I would like all checkboxes to default to 'checked':

    SELECT
    GROUP_CONCAT(c.CID)
    FROM smi.crp c

    BUT, this doesn't work when the select list choice changes. And I don't seem to be able to use mydbr_param_prev1 in the default selection parameter query.

    Is this possible? Or am I doing something wrong?

    Also, are there any plans in the future for using Checkboxes as the SOURCE for a connected parameter instead of just Select Lists or Radio Buttons?

    Thank you,

    Cris

  2. myDBR Team, Key Master

    Cris,
    when the connected parameter is updated, the selection of the checkboxes is empty. You can add the 'find'-attribute to the checkbox so that you can check all the options at one click.

    For now the checkboxes cannot be used as a source for the connected parameter. We can add this as a requested feature.

    --
    myDBR Team

  3. cris, Member

    I understand we can use the 'find' attribute to check all of the options at once, but is there a way to check the boxes automatically / programmatically when the connected parameter is updated?

    Thank you,

    Cris

  4. myDBR Team, Key Master

    For now no, but we can take a look if this could be possible.

    --
    myDBR Team

  5. cris, Member

    Great, thank you very much.

    Cris

  6. myDBR Team, Key Master

    Cris,
    the latest build contains an option to set the checkbox as selected. You can return 'selected' in the fourth column of the connected parameter (3rd being the optional optgroup).

    So based on your example, the connected parameter query would be:

    SELECT DISTINCT c.CID, c.CName, null, 'selected'
    FROM smi.crp c
    WHERE c.GID = mydbr_param_prev1
    ORDER BY c.CName;

    --
    myDBR Team

  7. cris, Member

    Thank you for the excellent support, but I still can't get it to work. Perhaps I oversimplified my example. Here is the full connected parameter query:

    SELECT DISTINCT b.BlockID, f.FieldName, c.PluralCropName, null, 'selected' FROM smi_test.crop c JOIN smi_test.Block b on b.CropID = c.CropID JOIN smi_test.field f on b.FieldID = f.FieldID JOIN smi_test.Section s on b.BlockID = s.BlockID JOIN smi_test.growerinfo g on f.GrowerID=g.GrowerID JOIN smi_test.SampleTable sa on s.SectionID = sa.SectionID WHERE sa.SampleType=10 AND sa.SampleCurrent=1 AND g.GrowerID = mydbr_param_prev1 ORDER BY c.PluralCropName, f.FieldName;

    Does it make a difference that I have multi-level checkboxes?

    Thank you,

    Cris

  8. myDBR Team, Key Master

    Chris,
    our bad. The version was done, but it was not deployed. Just run the updater and you should be fine.

    Note that the statuses of the checkboxes that you get when first run the report are governed by the default setting. The connected 'selected' takes effect once the user re-eselects the base values.

    --
    myDBR Team

  9. cris, Member

    I am still having trouble getting this to work with the connected parameter query I posted above. Your solution works when I remove the hierarchy from my query and just create a query with an ID followed by a name (SELECT b.BlockID, f.FieldName, null, 'selected'). However, when I try to create a hierarchy of checkboxes (SELECT b.BlockID, f.FieldName, c.PluralCropName, null, 'selected'), the checkboxes are not automatically checked. Is there a solution for this issue?

    Thank you very much for helping me to get this working!

    Cris

  10. myDBR Team, Key Master

    The parameter query has format:

    select ID, user_visible_value, optgroup, 'selected'
    from parameter;

    where all but ID are optional. If you do not use the optgroup and need to use the 'selected', pass NULL in optgroup.

    The 'selected' option should be in the fourth column, so your query without the optgroup is:

    SELECT b.BlockID, f.FieldName, null, 'selected'

    and with optgroup:

    SELECT b.BlockID, f.FieldName, c.PluralCropName,  'selected'

    --
    myDBR Team


Reply

You must log in to post.