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

More accessing autosearch variables

edited October 2006 in DADE
Thanks to Nico Cizik of DM for the earlier reply. There seems to be one
problem with this method - it goes like this......
1. You have, say, a file containing invoice details and a field InvoiceDate
2. You want to list all the invoices for September 2006 and have the report
header print the chosen date range
3. you set up autosearch so that it asks the user for -
InvoiceDate > "user input" Autosearch = yes
InvoiceDate < "user input" Autosearch = yes
4. in the before print event of the report header you put -
variable1.value := report.autosearchcriteriabyname('MyRep','InvoiceDate');
variable2.value := report.autosearchcriteriabyname('MyRep','InvoiceDate');
5. When you run the report and enter dates 31/08/2006 and 01/10/2006 into
the autosearch data entry boxes the report header says "from 31/08/2006 to
31/08/2006" which, of course is incorrect.

When "autosearching" more than once using the same file field how do you
"tell" autosearchcriteriabyname that you want the second (or third etc) user
input criteria for this field and not the first ?

Comments

  • edited October 2006
    Hi David,

    If you are just after the two values, you will need to use the
    TppAutoSearchField.Values property to get access to both values. For
    instance...

    var
    lAutoSearchField: TppAutoSearchField;
    begin

    lAutoSearchField :=
    Report.AutoSearchCriteriaByName('MyRep','InvoiceDate');

    Variable1.Value := lAutoSearchField.Values[0];
    Variable2.Value := lAutoSearchField.Values[1];

    end;

    Another option is to use the Report.GetAutoSearchDescriptionLines routine to
    access the full description of the user entry. Something like the following
    would be possible in RAP using a memo's OnPrint event...

    Report.GetAutoSearchDescriptionLines(Memo1.Lines);

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.