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

Skip and SkipBack behavior

edited August 2010 in General
I find that when I use the skip and skipback for ignoring records that all
works if there is at least one record not skipped.
Recently I had a situation with only two records and both were supposed to
be skipped, yet one always prints Is this normal? I would think not but
may be that was not the intent of these two methods. Can you verify?
Thanks

Comments

  • edited August 2010
    Hi Eug,

    Where are you making this call (which event)? The Skip routine should
    simply move to the next record without increasing the traversal count
    however if it is called too late, you may be getting incorrect results.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited August 2010
    I followed example 116. I do the calls in the events of the pipeline:
    OnFirst, OnNext, OnLast, OnPrior.
    As I said before this only happens when all records are skipped. Is it
    possible it can't skip when at EOF or BOF therefor or picks at least one
    record

  • edited August 2010
    Hi Eug,

    Thanks for the explanation. You are correct in that the Skip example was
    not intended to be used when all records are to be skipped. Ideally if you
    would like to filter out all records of a dataset, you would do so in SQL
    using a Query.

    Inside the example, you can work around the issue by isolating the case
    where all records are skipped, disconnecting the pipeline for that case.
    You will however need to remember to reconnect it after you are finished
    with the report.

    while not(Table1.EOF) and (Copy(Table1.FieldByName('Category').AsString,
    1, 1) = 'S') do
    ppBDEPipeline1.Skip;

    if not(Table1.EOF) then
    FValidRecordsFound := True
    else if (Table1.EOF) and not(FValidRecordsFound) then
    ppReport1.DataPipeline := nil;

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