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

Returning a value from a report

edited July 2009 in General
Using RB Enterprise 11.04, Delphi 2006. My report is an invoice, the
invoice amount is calculated in the report. How can I return the invoice
amount that is displayed on my report back to Delphi after printing?

Thanks,

David

Comments

  • edited July 2009

    One option is to use Report.Paramters[ ]. Add a Report.Parameter. Give it a
    name and a dataype. Write code inside the report to update the parameter.
    Report.Parameters can be access via RAP code and Delphi code.


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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited July 2009
    Nard,

    The value I want to return is calculated in a subreport. I have declared a
    global variable:

    vInvoiceAmount: double;

    The invoice amount is calculated in the OnGetText event and at that point, I
    set vInvoiceAmount to the calculated amount. The only problem is that I
    can't find the right place to assign vInvoiceAmount to my
    Report.Parameters['InvoiceAmount'].

    Any help is appreciated.

    David
  • edited July 2009

    Report.Parameters[ ] is read-only. Try
    Report.Parameters.Items['InvoiceAmount'].Value



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

    Best regards,

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