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

AV! - report works fine in design/preview, crashes when printed from Delphi

edited May 2002 in General
I have a report that is fine (shows correct data) in design and preview
modes, but crashes when I start it with

LabNumber := SomeMethod; // works
dsetSingleRequest.Parameters.ParamValues['LabNumber'] := LabNumber; //
works
dsetSingleRequest.Close; // works. this dataset is hooked up to the
master pipeline.
dsetSingleRequest.Open; // works
reportRequest.Print; // crashes on this!

It crashes with 'exception class EAccessViolation'

Any ideas what may be causing this?

(it has 2 subreports if that matters).

Thanks,

Lauchlan M.

Comments

  • edited May 2002
    This can be due to a lot of things but is most likely related to the
    parameters change since that is the only thing that is being varied between
    design and runtime. Which dataset component are you using? Also, you don't
    have to manually open the dataset as the pipeline will do that when the
    report prints.

    --
    Cheers,

    Alexander Kramnik
    Digital Metaphors

  • edited May 2002
    > This can be due to a lot of things but is most likely related to the
    between

    ADODataSet

    The command text for the master dataset (with the parameter) is:

    <<

    select [a bunch of fields]

    from Requests r, Patients p, Staff s

    where
    r.LabNumber = :LabNumber
    and r.patientID = p.patientID
    and s.StaffID = r.RequestingMO


    I added a message dialog to check it has a valid LabNumber before it sets
    the parameter (it does)


    OK. I didn't know . . . I guess it's best to be on the safe side!

    Thanks,

    Lauchlan M.
  • edited May 2002
    I tried your code on some sample data here with a report that printed a
    single data field and didn't receive any errors. Are there any event
    handlers in the report that could be blowing up at run time? You could also
    try reducing the issue to some simpler cases to maybe narrow down the
    problem. First get rid of the search criteria and just run the report, then
    if that works provide a static search criteria rather than assignining a
    calculated one. This might help you narrow down the problem. If the problem
    still persists please send a sample project which reproduces the problem to
    support@digital-metaphors.com

    --
    Cheers,

    Alexander Kramnik
    Digital Metaphors

  • edited May 2002
    Are you using report templates that you have saved to disk and loading them
    at runtime?

    Mark Greenhaw
    Vulcan Software Systems

  • edited May 2002

  • edited May 2002
    cc: support@digital-metaphors.com

    Alexander, I have pinned down where and how the problem occurs and since it
    may be a bug, have also cc:d it to your support email address to try to
    ensure it gets into your bug resolution process.

    The problem: I had one report on the form and needed to make a similar,
    second report. I used the right click -> edit -> copy and then right
    click -> edit -> paste to get a copy of the report component. I hooked this
    up to the second set of master/detail datasets and pipelines (copied in the
    same way).

    The original report still works correctly, and the copied set of datasets
    and pipelines work correctly. The copied report however always throws an AV
    when run. This is regardless of the complexity of the report: reducing it
    down to one field still throws and AV, compared to a new report with exactly
    the same field which doesn't.

    Since copying a report doesn't work, what is the recommended way of
    reproducing similar report components?

    Thank you,

    Lauchlan Mackinnon.

    also
    then
    problem
    to
  • edited May 2002
    cc: support@digital-metaphors.com

    Alexander, I have pinned down where and how the problem occurs and since it
    may be a bug, have also cc:d it to your support email address to try to
    ensure it gets into your bug resolution process.

    The problem: I had one report on the form and needed to make a similar,
    second report. I used the right click -> edit -> copy and then right
    click -> edit -> paste to get a copy of the report component. I hooked this
    up to the second set of master/detail datasets and pipelines (copied in the
    same way).

    The original report still works correctly, and the copied set of datasets
    and pipelines work correctly. The copied report however always throws an AV
    when run. This is regardless of the complexity of the report: reducing it
    down to one field still throws an AV, compared to a new report with exactly
    the same field which doesn't.

    Since copying a report doesn't work, what is the recommended way of
    reproducing similar report components?

    Thank you,

    Lauchlan Mackinnon.

    also
    then
    problem
    to
  • edited June 2002
    I wasn't able to verify this as a bug. I set up a master detail relationship
    linked on the pipelines and connected that to a report. I then selected all
    the components (datasets, pipelines, report) and copied and pasted them back
    onto the form. Both reports ran without any errors. Your problem is most
    likely due to the pipelines and not the report. When you copy the pipelines
    keep in mind that not all of the properties will be changed as you expect.
    For example with a master detail setup the MasterPipeline property of the
    copied detail pipeline will still point to the original master rather than
    the copied master. This was the only change I had to make, set the
    MasterPipeline of the copied detail, to make the copied report run properly.
    --
    Cheers,

    Alexander Kramnik
    Digital Metaphors

  • edited June 2002
    > onto the form. Both reports ran without any errors. Your problem is most
    pipelines
    properly.

    ok, it seems you are right - one of my subpipelines was pointing to an
    incorrect master. It would be nice though if it could tell me this rather
    than giving me an AV . . . maybe in a future version . . .

    Thanks!

    Lauchlan M.
  • edited June 2002


    Actually, it is still giving me an AV. I saved the first report to file,
    loaded it in the second report, and switched over all the pipeline
    references to the correct ones. I don't know what's going on. Maybe I should
    just send you the form/project . . .

    Thanks,

    Lauchlan M.
  • edited June 2002
    > Actually, it is still giving me an AV. I saved the first report to file,
    should

    Sent to your email address in zip format.

    Lauchlan M.
This discussion has been closed.