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

AutoSearchField

edited October 2007 in RAP
Hello again!

procedure ReportAfterAutoSearchDialogCreate;
begin
Report.AutoSearchFields[0].Value:=
FormatDateTime('dd.mm.yyyy',CurrentDate);
end;

According to my understanding of the helpfile this should change the value
before the dialog
is showed to the user, with the changed value as a default in the dialog,
but the dialog is showing
the value that is initially set on the search-tab in the querydesigner.

What am i doing wrong?

Best regards,
Terje

Comments

  • edited October 2007
    Surely as this event is called AFTERAutoSearchDialogCreate, it is too late
    to change the text in the dialog. I'd have thought that
    BEFOREAutoSearchDialogCreate would be more appropriate?

    Jason Sweby
    Software Development Manager,
    Carval Computing Limited, Plymouth, UK

    Payroll - HR - T&A - Access Control

  • edited October 2007
    I tried to move the code to the BeforeAutoSearchDialogCreate but the result
    is the same. No change in the default values in the AutoSearchFields.

    This is what the help-file says about the event
    "AfterAutoSearchDialogCreate"
    This event fires after the AutoSearchDialog has been created, but before it
    has been configured to reflect the AutoSearchFields. Changes made to the
    AutoSearchFields from this event will be reflected in the dialog.

    <

    Best regards,

    Terje

    "Jason Sweby" skrev i melding
  • edited October 2007
    If you want to affect the date the user sees in the dialog, I think you
    would have to write:

    Report.AutoSearchFields[0].SearchCriteria :=
    FormatDateTime('dd.mm.yyyy',CurrentDate);

    not .Value

    Regards, Paul.


  • edited October 2007
    Sorry but that did not work. And yes i want to affect the date the user sees
    in the dialog and
    show them current date. In what property is the values the users see in a
    dialog stored?

    Mvh, Terje


  • edited October 2007
    Yes, sorry, that isn't the right property. Try:

    Report.AutoSearchFields[0].SearchExpression :=
    FormatDateTime('dd.mm.yyyy',CurrentDate);

    Paul.



This discussion has been closed.