Home End User
New Blog Posts: Merging Reports - Part 1 and Part 2

date ranges in autosearch variables

edited November 2009 in End User
I have been asked to include date ranges in autosearch fields, and not
to set them for show all. However, when they are set in this fashion,
the date picker controls come up with no date, and a user who clicks
through on the dialog too quickly is then informed of an error, because
the dates are empty strings.

I have seen that if I define the beginning of the range as >= and
mandatory, and the end in another entry as <= and mandatory, both are
populated with today's date. But this means putting two rows in the
dialog, and is less clear, IMHO, than the range row which selecting
between presents.

Is there no way to select between, and have the date pickers
initialized with today's date?

Thanks,


--

Bill

Comments

  • edited November 2009
    Hi Bill,

    When using the Between or Not Between operators and autosearch, you can
    initialize both values by separating them with a comma in the Query
    Designer. If you would like to initialize them as today's date, you can do
    so inside an early event such as the OnInitializeParameters. Something like
    the following...

    procedure TForm2.ppReport1InitializeParameters(Sender: TObject; var aCancel:
    Boolean);
    begin
    ppReport1.AutoSearchFields[0].SearchExpression := DateToStr(Now()) + ',' +
    DateToStr(Now());
    end;

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited November 2009
    Nico Cizik (Digital Metaphors) wrote:


    Nico,

    Thanks, I have these under control now.

    --

    Bill
This discussion has been closed.