Limit selectable date range in parameter calendar selector?

(6 posts) (2 voices)
  1. duane, Member

    I'd using a datetime parameter for a report and the calendar selector is used to select the date. However it includes years in the future which aren't relevant and not enough years in the past. Is there a way to set this range so that the appropriate range is set for the report?

  2. myDBR Team, Key Master

    You can do that with Javascript:

    Assuming your date field is the 3rd parameter (u3), you can use:

    <script> $(document).ready(function() { $("#u3").datepicker( "option", "yearRange", "-50:+0" ); }); </script>
    --
    myDBR Team

  3. myDBR Team, Key Master

    To make life easier, we've added the year range as an option in the latest build.

    --
    myDBR Team

  4. duane, Member

    Thanks! Where do I set the year range? Under 'Other > Year' of 'Report Parameters' when editing the report? Do I put in a range, like you have above in the JS code?

  5. duane, Member

    FYI: just tried -50:+0 under the Edit report > Report Parameters > Other > Year and it worked fine - thanks!

  6. myDBR Team, Key Master

    Yes,
    it's under Report parameters → Other → Year.

    You can use either format "from:to" (1960:2014) or "-years_back:+years_forward" ("-50:+1" becomes "1964 - 2015").

    --
    myDBR Team


Reply

You must log in to post.