AV! - report works fine in design/preview, crashes when printed from Delphi
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.
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.
This discussion has been closed.
Comments
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
http://www.digital-metaphors.com
info@digital-metaphors.com
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.
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
http://www.digital-metaphors.com
info@digital-metaphors.com
at runtime?
Mark Greenhaw
Vulcan Software Systems
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
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
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
http://www.digital-metaphors.com
info@digital-metaphors.com
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.
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.
should
Sent to your email address in zip format.
Lauchlan M.