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

Could not run program: Variable1OnCalc

edited March 2004 in RAP
I am trying to use RAP for the first time but I am having some problems. I
added a variable to my report and the Variable1OnCalc looks like:

procedrue Variable1OnCalc(var value: variant);
begin
Value := Value+PAYMENTSHDR['AmountRequested'];
End;

The calculations compiles fine but when I preview the report I get the error
"Could not run program: Variable1OnCalc"
But if I change it to look like this it runs just fine:

procedrue Variable1OnCalc(var value: variant);
begin
Value :=PAYMENTSHDR['AmountRequested'];
End;

I have made sure I included raIDE and raCodMod in my uses clause.

Any ideas?

Thanks.

Comments

  • edited March 2004
    Hi Phillip,

    The reason you are seeing this error is that the type of the Variable does
    not match the type you are trying to set it to. In the Report Designer, be
    sure you set the TppVariable's type to Currency, or Double. This can be
    done by selecting the variable and using the combo box at the top right of
    the designer. The default is "String".

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2004
    Yep, that was it. I can't believe I didn't catch that.

    Thanks

This discussion has been closed.