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

Testing RAP function outside ReportBuilder

edited May 2007 in RAP
I'm trying to test RAP functions outside ReportBuilder. I create a
TraParamList and add a couple of parameters using AddParam,
CreateValuePointer and SetParamValue. However, when I call the
ExecuteFunction of the RAP class, I get an access violation when using
GetParamValue. When I test the code in ReportBuilder, everything is fine.

This is the calling code:

var
Param: string;
begin
ParamsList := TraParamList.Create;

Param := 'This is a param';
ParamsList.AddParam('FirstParam', daString, nil, '', False, False);
ParamsList.CreateValuePointer(0, Param);
ParamsList.SetParamValue(0, Param);

FmyRAPFunction.ExecuteFunction(aParams);

It falls over in the ExecuteFunction code:

GetParamValue(0, Param1);

Does anyone have any idea as to what might be going wrong?

Aaron.

Comments

  • edited May 2007
    Hi Aaron,

    The ExecuteFunction routine cannot be called separate from the report
    object. What exactly are you trying to accomplish. If this is a pass thru
    function in Delphi, you should be able to test it using a simple report
    example.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited May 2007
    We're trying to automate our testing using DUnit.

    Aaron.


This discussion has been closed.