Accessing main report TppParameterList
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
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
This discussion has been closed.
Comments
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