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

Pass Through Functions

edited January 2003 in General
Hi !
We have main app. that creates and manages end user reports at run time.
All of the reports contain pass-through funcs. that refer to app's main form
queries and return values such as client id, name, check date etc. to
reports.
e.g. lsResult := frmMainForm.QueryNameFIELD_NAME.AsString. Reports
are being saved as blobs in DB.
At the same time we have service app that auto prints those reports. Service
app has differrent form naming. All of the reports but one appears to have
correct data. One report that doesn't work has a pass-through function that
creates and runs query, it errors out with
'Cannot compile program ReportBeforePrint' message, event that contains that
func.

My question is, how service can know about main apps forms and queries, why
does
it work ? And why the one with run-time created query doesn't ?

Thank you,
Vadim K.

Comments

  • edited January 2003
    Place a breakpoint in the code of that pass through function. What happens
    at runtime in that method that creates the query? What is the result of the
    query? Perhaps it is returning nil to the RAP code which is not expecting to
    get a nil object?


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited January 2003
    It works fine if it's being run from main app.
    The problem is that another application (service for this instance)
    can not compile report that has func. referring to query on main app.

    What are we doing wrong ?

    Thanks,
    Vadim K.
  • edited January 2003
    I misunderstood. The main app is the one that has the pass through function
    in delphi code. It is part of the main exe. The service app will also need
    to have the RAP pass through function compiled into it. Perhaps you can use
    a single package to contain the pass through functions for use by both
    applications so that you don't have duplicate code in both apps.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited January 2003
    It works fine if being run from main app.
    The problem is that another applicaton (service in this instanse)
    can not compile report that has func. referring to query on main app.
    Why does it work in some cases and doesn't in another ?

    What are we doing wrong ?

    Thanks, Vadim K.
  • edited January 2003
    Thanks, sorry I replied twice
This discussion has been closed.