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

Access Violation on Navigating Print Preview

edited March 2005 in Subreports
Here's my setup, I'm running Delphi 2005 sp1, and RB 9.01.

I've got a Master/Detail relationship with:

MasterCDS -> MasterDataSource -> MasterDBPipeline -> MasterReport
ReportCDS -> ReportDataSource -> ReportDBPipeline -> Report1

Report1 is very simple, just TppDBRichText in the detail band and a page
number system variable in the header band.

Since I want the report to do a page break on every new record and I want
page numbering to also reset on each new record, I decided to make it a
subreport. The Master/Detail will be 1 to 1 here.

The Master report is also very simple, just an empty report with a detail
band.

The Master/Detail relationship is set up by setting ReportCDS->MasterSource
property to MasterDataSource.

I then set up the subreport with the following code:

SubReport := TppSubReport.Create(ReportBuilderForm);
SubReport.Band := MasterReport.DetailBand;
SubReport.SetReportProperty(Report1);
SubReport.PrintBehavior := pbSection;
SubReport.ParentPrinterSetup := false;
SubReport.ResetPageNo := true;

When I do the preview (just MasterReport.Print; ), I can navigate through
the pages of the report, forward and back, until I get to the page where I
go to a new record, I can go forward all I want, but as soon as I try to
navigate back, it hangs. It may be when it tries to go to the previous
record, I'm not sure. If I cancel and then close, I get an access
violation, with a stack like this:

:7c81eb33 kernel32.RaiseException + 0x52
:00403b94 NotifyNonDelphiException + $1C
:7c90378b ntdll.RtlConvertUlongToLargeInteger + 0x46
:0047c114 TCustomForm.DefineProperties

Any idea about this? I've tried everything I can think of.

Thanks,
Rob Clawson

Comments

  • edited March 2005
    Hi Rob,

    I tried creating a simple example of what you are trying to do using the
    DBDEMOS database but was unsuccessful in creating the behavior you describe.
    If possible, please send a small example demonstrating the issue that I can
    run on my machine in .zip format to support@digital-metaphors.com and I'll
    take a look at it for you.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

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