AV in RBRCL76.bpl
I'm using the DrillDown capability to pop up a dialog for data entry. In the
dialog some data can be changed that changes the report. My code looks like
this:
procedure TDMJobListingReport.regDetailDrawCommandClick(Sender,
aDrawCommand: TObject);
var
tmp : integer;
begin
inherited;
// create my data entry form
with TfrmJobPromisedCalendarDataEntry.Create (nil) do
try
// execute does a showModal
if execute (TppDrawCommand (aDrawCommand).Tag)
then
begin
showMessage ('Step1');
// get page # so can move back to it after regenerate
tmp := rbDesigner.Viewer.AbsolutePageNo;
showMessage ('Step2');
// not sure this is needed
rbReport.Cancel;
showMessage ('Step3');
// close then re-open all datasets
openPromisedJobsCalendarDataset;
showMessage ('Step4');
// regenerate the report... screen updates after this step
rbDesigner.Viewer.RegenerateReport;
showMessage ('Step5');
// not sure this is needed... just trying diff things
application.ProcessMessages;
showMessage ('Step6');
// if user was on a different page move back to it...
// # pages will not change
if tmp <> 1
then rbDesigner.Viewer.GotoPage (tmp);
end;
finally
free;
end;
end;
The AV happens after Step6, but only sometimes. Usually, the first time the
data entry dialog is used is when the AV pops up, but the program keeps
working and all seems okay. On subsequent uses of the data entry dialog the
AV does not happen... Plus, it happens even though I'm on page 1 in the
viewer, so, when the GotoPage code is presumably not firing...
Any ideas why RBRCL76.bpl would intermittently give an AV here?
dialog some data can be changed that changes the report. My code looks like
this:
procedure TDMJobListingReport.regDetailDrawCommandClick(Sender,
aDrawCommand: TObject);
var
tmp : integer;
begin
inherited;
// create my data entry form
with TfrmJobPromisedCalendarDataEntry.Create (nil) do
try
// execute does a showModal
if execute (TppDrawCommand (aDrawCommand).Tag)
then
begin
showMessage ('Step1');
// get page # so can move back to it after regenerate
tmp := rbDesigner.Viewer.AbsolutePageNo;
showMessage ('Step2');
// not sure this is needed
rbReport.Cancel;
showMessage ('Step3');
// close then re-open all datasets
openPromisedJobsCalendarDataset;
showMessage ('Step4');
// regenerate the report... screen updates after this step
rbDesigner.Viewer.RegenerateReport;
showMessage ('Step5');
// not sure this is needed... just trying diff things
application.ProcessMessages;
showMessage ('Step6');
// if user was on a different page move back to it...
// # pages will not change
if tmp <> 1
then rbDesigner.Viewer.GotoPage (tmp);
end;
finally
free;
end;
end;
The AV happens after Step6, but only sometimes. Usually, the first time the
data entry dialog is used is when the AV pops up, but the program keeps
working and all seems okay. On subsequent uses of the data entry dialog the
AV does not happen... Plus, it happens even though I'm on page 1 in the
viewer, so, when the GotoPage code is presumably not firing...
Any ideas why RBRCL76.bpl would intermittently give an AV here?
This discussion has been closed.
Comments
6:02AM...
If possible please send a small example that demonstrates this behavior to
support@digital-metaphors.com and I'll take a look at it.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com