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

AV in RBRCL76.bpl

edited January 2004 in General
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?

Comments

  • edited January 2004
    I'm using Delphi 6 with SP2. The time stamp on RBRCL76.bpl is 3/17/03,
    6:02AM...

  • edited January 2004
    Keith,

    If possible please send a small example that demonstrates this behavior to
    support@digital-metaphors.com and I'll take a look at it.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.