Reading tfrxMemoView.Value in runtime

edited 7:06PM in FastReport 4.0
I need to change the overlay image file during runtime, based on a language code in the customer's data.

To do this I have hooked an ' OnbeforePrint' event on the report.

The problem is that when this event occurs, I can access the Memoview with findcomponent, but i cannot read the value that is inside. All i get is the memo's value from design-time (meaning the datasetname and the datafieldname).

I have tried (from tfrxmemoview) the properties Value, Text, Memo.Text, GetComponentText, and ToString, but none of these give me the value (code) of the memo. I can see it in the report when it is printed??

Any clues?

Comments

  • gpigpi
    edited 7:06PM
    Try to use TfrxReport.Calc function or OnAfterPrint event
  • Anu de DeusAnu de Deus Hampshire, UK
    edited 7:06PM
    I'm not sure about this, but try using Get() in your OnBeforePrint:

    StrVar := Get(MemoView1.text);

    But keep in might that you probably need to trim the memoview.text value, see this post:
    http://www.fast-report.com/en/forum/index....amp;#entry22017

    If it doesn't work initially, try putting the value between quotes before calling get(), and play with the brackets as well,
    like:
    get('[Data_Threat."Score"]')
    get('''[Data_Threat."Score"]''')
    get('Data_Threat."Score"')
  • edited 7:06PM
    Move your code to the memo's OnAfterData-event, and check out the TFrxMemoView(sender).Text. You can also adress 'value' in this event, but this will be incomplete if your memo contains more than one expression.

    See chapter 6.12 in the users manual.

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.