Home General

background thread

edited May 2010 in General
Hi,

I'm trying to print a report from a background thread.
Basically I have a form with data access components (Direct Oracle Access
datasets), some data aware controls (grid, etc) and a report.
From this form I create a new thread and call Report.Print inside of it.
This seems to work but:
1. sometimes some records are skipped
2. in master-detail reports sometimes the master record is not linked to the
correct details.

Because the same code works fine when executed from main thread (and I know
VCL components are not thread safe) I belive there's something VCL
components do behind the scenes that change the current record while the
background thread print.

Is this scenario supported?
Can you provide some documentations and/or examples about?

I'm using RB Enterprise 11.04 on Delphi 2006.

Kind regards,
Corrado

Comments

  • edited May 2010
    ReportBuilder has built-in support for printing in a background thread. See
    the RBuilder help topic for TppReport and from there browse the TppReport
    properties and select the topic for BackgroundPrintSettings. The topic
    contains details on providing a threadsafe container for the report,
    providing thread-safe data access, and for suppressing dialogs.



    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.