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

Accessing Main Report Parameter in SubReport

edited April 2008 in General
Using RB Ent 10.07. In an OnGetText event in a subreport, I want to be able
to access the main report's parameters. In the main report, I would do:

Report.Parameters['param1']

But trying this in the subreport gives me an error "Expected '(' or '[', but
found 'Parameters' instead"

Thanks,

David

Comments

  • edited April 2008
    Hi David,

    For future reference, please post RAP questions to the RAP newsgroup. This
    helps us and others understand the issue better and provide a quick and
    accurate answer.

    The reason you are getting an error is that the subreport (TppChildReport)
    object does not have a Parameters property. In order to access any main
    report properties or values from a subreport in RAP, you will need to use
    Global Variables. Creating a global variable for each passed parameter or
    perhaps using a single TStringList to hold the parameters will give you
    access to these values when coding inside the subreport.

    --
    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.