Operating values of two variables

edited 3:39AM in FastReport 3.0
Hi folks,

I'm stuck with and (I believe) newbie related topic. I'm using the code showed below to add variables to the report from code:
Report.AddVariable('R01','Var25t',c1trueDBgrid4.Item[I,25]);
Report.AddVariable('R01','Var26t',c1trueDBgrid4.Item[I,26]);

I need to create a sum operation in the report and I can't see the correct sintax.
How can I tell Fastreports that the value I need to represent is the sum of Var25t and Var26t?

Im using <[Var25t]+[Var26t]> and dimilar sintax but without success. Any hint?


Note: Using Fastreports in delphi .Net

Thanks

Comments

  • edited 3:39AM
    I've managed to use a code script (PascalScript) for doing what I needed.

    For any people interested...

    Memo123.text:=VarToStr(StrToFloat(<Var23p2>)+StrToFloat(<Var23p3>))

    used in Memo123OnBeforePrint Event.


    There is an easy way? without using Pascalscript, directly in memo expression perhaps?

    Thanks anyway
  • gordkgordk St.Catherines On. Canada.
    edited 3:39AM
    assuming the values are numeric
    make sure allow expressions is turned on for the memo and
    use [Var25t]+[Var26t]
    set display format of memo as desired.
    ;)

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.