Require at least one auto search parameter
Delphi 2010
RB 12.02 Build 279
Is there any way to specify that at least one of multiple auto search
parameters is required, but not all of them are required? Basically we
have several reports that can be run by Customer # or Date Range. We
can't constrain the user to enter both parameters, but we need to
require that at least one of them is entered b/c if they accidentally
run the report without entering either of the search parameters it can
bring the whole system to a crawl while the DB is returning every record
in existence.
What is the best way to achieve this?
--
Regards,
Branden Johnson
Integrity Software Design
RB 12.02 Build 279
Is there any way to specify that at least one of multiple auto search
parameters is required, but not all of them are required? Basically we
have several reports that can be run by Customer # or Date Range. We
can't constrain the user to enter both parameters, but we need to
require that at least one of them is entered b/c if they accidentally
run the report without entering either of the search parameters it can
bring the whole system to a crawl while the DB is returning every record
in existence.
What is the best way to achieve this?
--
Regards,
Branden Johnson
Integrity Software Design
This discussion has been closed.
Comments
Setting the Mandatory property to True for each AutoSearch field will
ensure that your user(s) enter a value before running the report. It
would also be possible to create a custom AutoSearch dialog that
determines if only one value has been entered. Setting both search
values to Mandatory will require that both are entered.
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
--
Regards,
Branden Johnson
Integrity Software Design
that valid entries have been made. I believe it checks the
AutoSearchField.Mandatory property. It should not be very hard to alter
this to accept the criteria if only one field is defined.
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
add the code to The OnAutoSearchDialogClose event to check first if
there are auto search parameters and second if at least one of them is
populated. My only problem is that this event is called even if the
user clicks "Cancel". How can I know from code (Delphi code, not RAP)
within the OnAutoSearchDialogClose that the user clicked cancel instead
of OK?
if myReport.AutoSearchDialog.ModalResult = mrOK then
// use pressed ok
else
// user pressed cancel
-
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
realized the solution a few minutes after posting.