How to Use Memo data

edited 11:42AM in FastReport 4.0
Dear FR Experts,
I am new to both Fast Report & Forum. I am creating a report there i wants to calculate a memo data from another memo, for example: Memo12 = Memo11*12
i tried like [<Memo11>*12] but it is not working. In previe its giving some random number like 432482.79874.
and also i tried [abs(<Memo11>)*12] thts also in same way.
Is there a way to calculate how i am expecting.

Please help me if you know this.

Thanks & Regards,
Alaguraja

Comments

  • edited 11:42AM
    Alagu wrote: »
    Dear FR Experts,
    I am new to both Fast Report & Forum. I am creating a report there i wants to calculate a memo data from another memo, for example: Memo12 = Memo11*12
    i tried like [<Memo11>*12] but it is not working. In previe its giving some random number like 432482.79874.
    and also i tried [abs(<Memo11>)*12] thts also in same way.
    Is there a way to calculate how i am expecting.

    Please help me if you know this.

    Thanks & Regards,
    Alaguraja

    Hi,

    You can try to use variables or you can also use database field. Apart from that, try to use this [Memo11.Value *12].
    Hope it works.


  • edited 11:42AM
    HERBERTS wrote: »
    HERBERTS wrote: »
    Dear FR Experts,
    I am new to both Fast Report & Forum. I am creating a report there i wants to calculate a memo data from another memo, for example: Memo12 = Memo11*12
    i tried like [<Memo11>*12] but it is not working. In previe its giving some random number like 432482.79874.
    and also i tried [abs(<Memo11>)*12] thts also in same way.
    Is there a way to calculate how i am expecting.

    Please help me if you know this.

    Thanks & Regards,
    Alaguraja

    Hi,

    You can try to use variables or you can also use database field. Apart from that, try to use this [Memo11.Value *12].
    Hope it works.

    When i use [Memo11.Value *12], irrespective of Memo11 data it is displaying zero value.
  • Anu de DeusAnu de Deus Hampshire, UK
    edited January 2010
    Try a different approach, via scripts on the OnAfterData or OnAfterPrint events.
    This example considers the value as an integer, fix it if it's a float of any sorts:
    Memo11OnAfterData(sender);
    var lParentBand : tFrxBand;
     lMemo12: TFrxMemoView;
     lMemo11Value: integer;
    begin
        lParentBand := tFrxBand(sender.parent);
        lMemo12:= TFrxMemoView(lParentBand.FindObject('Memo12'));
        if lMemo12 <> nil then begin
        // force the variant to an integer first (will except if null or not an integer, do extra code here for those cases):
        lMemo11Value:= Value; //This 'Value' variable is part of the FR system, it's what the sender will receive as its value to display
    // Put a showmessage of this result to debug its result; if not working, try lMemo11.value instead of text
        showmessage(inttostr(lMemo11Value));
        lMemo12.text := inttostr(lMemo11Value * 12); // 
      end;
    end;
    

    It should work
  • gordkgordk St.Catherines On. Canada.
    edited 11:42AM
    also note that objects within a band are processed in creation order so you cannot set the value
    of a previously processed object from one that comes after.
    also the value property of a memo is that of the last variable processed within the memo

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.