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

Accessing main report TppParameterList

edited January 2005 in Subreports
Hi,

I have a Master with several parameters (Factor2, Factor3, UnitPerCrate). I
have a child report that NEED to access these parameters. I tried the
following statement :

ContTemp := TotalCont -
(int(TotalCont / TppReport(Report.MainReport).Parameters['Factor2']) *
TppReport(Report.MainReport).Parameters['Factor2']);
Value := ContTemp;

It causes an Access Violation. I comment the ContTemp assignment and the AV
goes away (but my value is still incorrect). How can I access the MainReport
parameters ?

David Caouette

Comments

  • edited January 2005

    Report.MainReport should return a reference to the main TppReport object.

    1. Delphi code

    When using Delphi code, the syntax

    Report.Parameters['ParamName']

    returns a reference to the TppParameter object. Then you need to use the
    TppParameter.Value property to access the value. Example:

    var
    lParameter: TppParameter;
    begin

    lParameter := ppReport1.Parameters['ppParameter1'];

    ShowMessage(lParameter.Value);

    end;

    2. RAP code

    For RAP code we were able return the Value when using the syntax

    Report.Parameters['ParamName']

    Example:

    ShowMessage(TppReport(Report.MainReport).Parameters['ppParameter1']);

    3. Nested expressions

    When using RAP, sometime nested expressions do not work well. In this case,
    use more intermediate local variables






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



    Best regards,

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