Parameters validation

(4 posts) (2 voices)
  1. situ, Member

    Hi

    When assigning parameters to a report is there a way to make at least one mandatory?

    Take an example where you have 3 input parameter drop downs, they all default to the value "All". If I run a report with it set like this then it will produce too much data. What I would like to is make a rule forcing the users to make sure at least one of the parameters is something other than "All".

    Update: One of the parameters my turn into a number of checkboxes

    Regards

    Simon

  2. myDBR Team, Key Master

    There is no such built in functionality that would do "make sure at least one of the parameters is selected". In order to do that you got couple of options:

    1) Check the parameters in the report and display a warning to user
    2) Use jQuery to insert the extra logic into the submit event and check the parameters before accepting the submit

    First one is bit easier to do, the second one would do exactly what you asked for.

    --
    myDBR Team

  3. situ, Member

    Regarding option 1 above can that tied the selecting the "Run Report" button?

    I assume in option 2 above that involves embedding jQuery script in the help / html field in the report definition, below the parameters specifications?

  4. myDBR Team, Key Master

    Option 1 will be effective in report, not in the parameter form.

    As for the option 2, you can place JS code into the "Help/JavaScript" field. In order to define your own handler for submit (user clicking the 'Run report'-button), you use the "submit":

    <script type="text/javascript">
    $('.param_input').submit(function() {
    alert('Place your own check here. Return true for OK, false for not OK');
    return false;
    });
    </script>

    --
    myDBR Team


Reply

You must log in to post.