Change memo.text inside a MasterData

edited August 2009 in FastReport 4.0
Hello,...

I've two Problems:

1. Probleme: I can change memo.text dynamically in Designer-Preview (frxReport1.DesignReport()) but not at the PreView (frxReport1.Print;)
!! It's running in designmode and Preview but not at the normal preview. Why??

2. Probleme: I've to change all memo.text (used as label) inside the report by button-press without losing the content of the memo.text used as Input-field.
The button-press is used to change the language of the Report (not of the fast report-tools) and is implemented in the Pascal-Script.

Solution for the "normale" memo.text: (Change memo.text directly)
procedure picLanguageSelectorOnPreviewDblClick(Sender: TfrxView; Button: TMouseButton; Shift: Integer; var Modified: Boolean);
var
...
begin
...
    LoadSetMemo('Memo3',dlgComboBox01_cmbSelection.Text,Ini, ReportTitle1);    
    LoadSetMemo('Memo5',dlgComboBox01_cmbSelection.Text,Ini, ReportTitle1);       
    LoadSetMemo('Memo6',dlgComboBox01_cmbSelection.Text,Ini, ReportTitle1);
    LoadSetMemo('Memo7',dlgComboBox01_cmbSelection.Text,Ini, ReportTitle1);
...

    Report.ShowReport;                                                                      
    Modified := false;    
...
end;


procedure LoadSetMemo( MemoName : string; Sprache : string;  Ini  : TIniFile; View : TfrxComponent);
var
  iniString   : string;                                                                    
begin
  iniString:= Ini.ReadString('MEMO_'+dlgComboBox01_cmbSelection.Text,MemoName+'.Text','');          
  if iniString <>'<<NULL>>' then TfrxMemoView(View.FindObject(MemoName)).Text :=iniString;
  
  iniString:= Ini.ReadString('MEMO_'+dlgComboBox01_cmbSelection.Text,MemoName+'.Hint','');  
  if iniString <>'<<NULL>>' then TfrxMemoView(View.FindObject(MemoName)).Hint :=iniString;

  iniString:= Ini.ReadString('MEMO_'+dlgComboBox01_cmbSelection.Text,MemoName+'.Description','');
  if iniString <>'<<NULL>>' then TfrxMemoView(View.FindObject(MemoName)).Description :=iniString;
end;

This is running well. Only the memo's modified by LoadSetMemo are changed. [img]style_emoticons/<#EMO_DIR#>/cool.gif" style="vertical-align:middle" emoid="B)" border="0" alt="cool.gif" /> Now, I use also a[/img]masterdata with memo. I change the content of the memo by following event
procedure MemoDataSetOnDblClick(Sender: TfrxView; Button: TMouseButton; Shift: Integer; var Modified: Boolean);
begin
  TfrxMemoView(Sender).Text := InputBox(TfrxMemoView(Sender).Description,TfrxMemoView(Sender).Hint,TfrxMemoView(Sender).Text);
  Modified := true;        
end;

MemoDataSetOnDblClick change the value of the report (visualization) but not of the report data. The probleme is, that I lose all changed data (visualization) of the masterdata by changing the language because of the Report.ShowReport. [img]style_emoticons/<#EMO_DIR#>/ohmy.gif" style="vertical-align:middle" emoid=":o" border="0" alt="ohmy.gif" /> How can I adress a memo of a masterdata direcly like[/img]TfrxMemoView(View.FindObject(MemoName)).Text .... [img]style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":unsure:" border="0" alt="unsure.gif" /> I have to adress the raw directly... but how. I think all memo inside the same coulom have the same name (or?). Thank you in anticipation .....[/img]>

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.