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

does not recognize current-record

edited February 2002 in General
Jim,

If I make a 5-level master-detail report using the afterscroll-event of the
different TTables ( SETRANGE() )
Rangebegin = rbCurrentRecord
Rangeend = rbCurrentRecord

does not work properly ( and that is also with paradox and memdataset )

It first repositions the record to Recordnr 1 of the range and then treats
that record as CURRENT record.

Example:

Level1.Rangebegin = rbCurrentRecord;
Level1.Rangeend = rbCurrentRecord;

Level2.Rangebegin = rbCurrentRecord; <======= moves to record 1 of the
range first in stead of staying on the correct record.
Level2.Rangeend = rbCurrentRecord;

Level3.Rangebegin = rbFirstRecord;
Level3.Rangeend = rbLastRecord;

Level4.Rangebegin = rbFirstRecord;
Level4.Rangeend = rbLastRecord;

Level5.Rangebegin = rbFirstRecord;
Level5.Rangeend = rbLastRecord;

Could you please look into it and give me a workaround for that ?

Leon

Comments

  • edited February 2002
    Well,

    Life ain't easy.
    I changed code in the afterscroll-event and now it works, so have a nice
    weekend.

    ==============================
    bad code:

    ID := dataset.fieldbyname('ID').asinteger;
    SetRange(.....)
    ==============================

    ==============================
    good code:

    ID := dataset.fieldbyname('ID').asinteger;
    IF ID <> OldId then
    begin
    SetRange(.....);
    OldId := ID;
    end;
    ==============================
This discussion has been closed.