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

Pulling Information from AutoSearch

edited October 2006 in RAP
Greetings -

I'm trying to create a report based on dates that the user enters.

I'd like to be able to include those dates in the report header.

Basically, I'd like it to look like this:

REPORT TITLE
For the period of (date1) through (date2)

I'm thinking this should be doable in RAP, but can't figure out how...

Any ideas?

Thanks in advance
- CK

Comments

  • edited October 2006
    Hi Chris,

    Try using the Report.AutoSearchCriteriaByName routine in rap to get access
    to the autosearch field. You can then access the Value property to assign
    the autosearch value your user entered to a report component in your header
    band.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2006
    Nico -

    Thanks for getting me started -

    here is what I did so far (as testing)

    [label2 is the label I want the date area to print]

    var
    DateGrab: TppAutoSearchField;
    begin
    DateGrab := Report.AutoSearchCriteriaByName('genledg','date');
    Label2.Caption := datetostr(dategrab.value);
    end;

    Now, when I run this, the first date entered appears in the label - All
    Good there!

    However, my search is doing a between. How do I access the second
    ending date?


  • edited October 2006
    Hi Chris,

    In this case you will want to use the AutoSearchField.Values[] property to
    access the values you need. For instance...

    var
    DateGrab: TppAutoSearchField;
    begin
    DateGrab := Report.AutoSearchCriteriaByName('genledg','date');

    Label1.Caption := DateToStr(DateGrab.Values[0]);
    Label2.Caption := DateToStr(DateGrab.Values[1]);
    end;


    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2006
    Hi Chris,

    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...

    ppReport1.GetAutoSearchDescriptionLines(ppMemo1.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.