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

OnTraverseRecord / Access Violation when no records match the condition...

edited May 2002 in General
Hi,

I'm using the "OnTraverseRecord" event to filter records to add to a
crosstab. Usualy everything goes fine. But when any of all records traversed
did not match my condition, I get an "Access violation".

Is it a bug ? If not how to prevent it ?

Thanks.
--
G. Plante
gplante@orologic.com

Comments

  • edited May 2002
    The crosstab engine checks for ppdaNoRecords in the DataPipeline.State
    property. Using the OnTraverseRecord event the engine will hit EOF on what
    is supposed to be the first record. I would just filter the data using the
    filter property of the data set, that way the no data condition will be
    detected without having to manually traverse the dataset...

    Cheers,

    Tom Ollar
    Digital Metaphors Corporation
  • edited May 2002
    Since my dataset is used to create 4 different crosstabs on the same report,
    I cannot filter the records with the filter property of the dataset at
    design time. Can I do that with RAP at runtime before each crosstab be
    generated ?

    If not what are the other choices I have ?

    Thanks!

    --
    G. Plante
    gplante@orologic.com

  • edited May 2002
    Yes, you can. Just create a pass thru function which sets the filter. See
    example 31 in the RAP example to see how to create a pass thru. Also, the
    on-line help has a step-by-step tutorial on how to create a pass thru...

    Cheers,

    Tom Ollar
    Digital Metaphors Corporation
  • edited May 2002
    Hi,

    since my end user does not have Delphi, but only have the reports generator
    we built (from your Report Builder components), he will not be able to add
    pass thru right ? So, what can he do to resolve the problem ?

    Thanks!

    --
    G. Plante
    gplante@orologic.com

  • edited May 2002
    Nothing. You'll need to create the pass-thru and send him a new
    executable...

    --
    Cheers,

    Tom Ollar
    Digital Metaphors Corporation
  • edited May 2002
    Hi,

    in you next version of Report Builder, is this problem will be fixed so when
    all records are skipped, the crosstab be enought intelligent to don't raise
    an access violation error ?

    Thanks
    --
    G. Plante
    gplante@orologic.com

  • edited May 2002
    If you can provide an example application which shows this problem, of
    course, we'll research it. In testing here skipping all records works fine.
    I just tested this by:

    1. Opening the crosstab example project in: 1. RBuilder\Demos\Crosstab

    2. Modified the event handler to read:

    aSkipRecord := True;

    3. Ran the project and previewed the report - correctly showed a blank page
    with no crosstab.

    4. Returned to the form at Delphi design-time. Accessed the Calc tab and
    coded the same thing as a RAP event handler.

    5. Ran the project and previewed the report - correctly showed a blank page
    with no crosstab.

    This was with Windows XP Pro, D6 Enterprise SP2, RB 6.03, HP LJ 5 Default
    printer

    Cheers,

    Tom Ollar
    Digital Metaphors Corporation
This discussion has been closed.