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

Rep Builder Prof in webservice?

edited November 2013 in General
Hi are there any concurrency issues using Rep Builder Prof. edition
(12.02/Delphi7) in webservices ?

I have a webservice loading template from sql-db, producing uniquely
named pdf-files and returning the contents of the pdf-file as array of byte.

Sometimes we see empty pdf-files or webservice generates errors like
"TppProducer Print to Printer the filedevice has already been created "

Regards
René/SSV

Comments

  • edited November 2013
    Den 12-11-2013 14:19, René Laursen - SSV skrev:> Hi are there any
    concurrency issues using Rep Builder Prof. edition
    Sorry, we are using Delphi 2010 not Delphi7. Anyway I don't think this
    makes any difference.
  • edited November 2013
    Rene,

    Any of the RB Editions can be used to implement a web service. RB Server
    Edition implements a multi-threaded web tier and is built upon the same
    classes in RB Std/Pro/Ent. That being said, threaded applications require
    the developer to provide to for thread safety. The RBuilder help topic for
    TppProducer BackgroundPrintSettings contains a good discussion. Also note
    that web apps typically run under a different Windows user account

    a. Make sure that you provide a thread-safe container for the report to
    execute.
    b. Make sure that no dialogs are displayed by the report (i.e. set
    Report.ShowPrintDialog, ShowCancelDialog, etc to False.
    c. Set Report.EnableProcessMessages to False.



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited December 2013
    Hi again

    Finally returning to this issue.
    Can you perhaps point me in the right direction concerning thread safety ?
    The report and datasources are all in the same datamodule and no dialogs
    are shown, what else is to be considered ....?

    I can't see no Report.EnableProcessMessages property ?
    (Using RB 12.02 Pro in Delphi2010)

    Regards
    René / SSV

    (Sorry for - once again - replying to you instead of the newsgroup )

    Den 12-11-2013 16:33, Nard Moseley (Digital Metaphors) skrev:
  • edited December 2013

    1. Report.EnableProcessMessages is a public property declared in the
    TppProducer class (ppProd.pas).

    2. The RBuilder help topic for TppProducer BackgroundPrintSettings contains
    a good discussion of thread-safety.

    3. In re-reading your original post I notice you say "Sometimes we see empty
    pdf-files or webservice generates errors like "TppProducer Print to Printer
    the filedevice has already been created." Make sure you are not calling
    Report.Print on the same report instance from different threads. Each thread
    needs to operate on a separate instance of the datamodule that contains the
    report, data connection, etc.


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

    Best regards,

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