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

RB effect DataChange event of DataSource

edited August 2001 in General
I don't understand with running a report would trigger the DataChange event
on my DataSource. To get around the problem, I have set the following
properties in my DBPipeLine.

MoveBy := 0;
RangeBegin := rbCurrentRecord;
RangeEnd := rbCurrentRecord;
SkipWhenNoRecords := False;

This still triggers the DataChange event on my DataSource. What am I doing
wrong?

Kevin

Comments

  • edited August 2001
    From the Delphi help on this event:

    Methods that can trigger this event include the Next or Prior methods for
    the dataset. Data-aware controls notify a data source of a data change when:

    Scrolling to a new record.
    Modifications to a field's data.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited August 2001
    Ok, I understand that, but I am only printing 1 row from my dataset. The
    table that the report is based is filtered to 1 row of data. Why would RB
    issue a first or prior method, especially when I set the RangeBegin and
    RangeEnd of the DBPipeline to rbCurrentRecord?

    Kevin

  • edited August 2001
    Just for the record, I was able to get around this by using the StateChange
    event instead. I still would like to know why RB is moving the record
    pointer when I have indicated to use the current record only.

    Kevin


  • edited August 2001
    I don't believe the code is optimized for this case. Next is called until
    EOF is true on the pipeline.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited August 2001
    That seems like a common bug. The code should be "while not eof do Next"
    instead of "repeat Next until eof".

    Richard

  • edited August 2001
    When the pipeline opens, it moves the dataset to the first record, causing
    the datachange event to fire. To see what is happening, you can change your
    library path to point to ..\RBuilder\Source and put a breakpoint at the
    beginning of your OnDataChange event handler and then put a breakpoint in
    ppEngine.pas in the procedure TppEngine.OpenDataPipelines; on the line
    which calls FMasterDataPipeline.First and this is the start of the sequence
    leading up to the OnDataChange event.



    Cheers,

    Jim Bennett
    Digital Metaphors


    "Richard Biffl" wrote
This discussion has been closed.