Default parameter isn't used if all parameters optional

(3 posts) (2 voices)

Tags:

No tags yet.

  1. john, Member

    could be a design choice, but i couldn't find it covered anywhere.
    With a report I have two parameters, both set as optional, one with a default value
    Expected behaviour - when report is run the default value is used for the parameter
    Actual behaviour - if all the parameters for the report are optional when run it uses empty values instead of default values. with select 'dbr.parameters.show'; the default value is populated into the parameter at the top of screen and clicking run report without changing anything gives a different result set.

    I have a list of dates and wanted to (with one report)
    1. only load all the records if asked to as it is a large result set - this works but i don't want it be default
    2. default to this year - so i have a default parameter query that works
    3. allow all input parameters to be null (or empty char strings) and have report select all records - this works with an or in where clause -deletedate is table column and inputyear is parameter. this also works
    ( year(deletedate) = inputyear OR CHAR_LENGTH(inputyear)=0 )

    thanks

  2. myDBR Team, Key Master

    John,
    how do you call the report or do you run it directly from the UI? We seem to have trouble replicating this behaviour.

    --
    myDBR Team

  3. john, Member

    Good call, I am running it from clicking on the report name in the edit code screen. If i run it from the menu it brings up the Parameter menu and works as expected.
    ps, first time i have had reason to use the auto-execute option - that makes this report perfect

    Thank you very much


Reply

You must log in to post.