Page 1 of 1

Using FastReports FRH change memo2 from Memo1

PostPosted: Sat Apr 08, 2023 2:22 pm
by reinaldocrespo
Hello FiveWinners;

Suppose I want to change text on memo2 after clicking on memo1 on a preview report. Let's say I have set property OnPreivewClick of memo1 to this:
Code: Select all  Expand view

//--------------------------------------------------
procedure Memo1OnPreviewClick(Sender: TfrxView; Button: TMouseButton; Shift: Integer; var Modified: Boolean);
var
   s: String ;

begin

   s := TfrxMemoView( Sender ).Text  ;
   TfrxMemoView( Sender ).Text  := InputBox('BI-RADS', 'LT:', s ) ;    
   memo2.Text := TfrxMemoView( Sender ).Text ;

   Modified := True;  //this will update preview memo1 but not memo2
   
end;
//----------------------------------------------------
 


Memo2.text contents will be changed but not displayed.

Anyone has an idea how to update preview so that Memo2 shows new data changed on event OnPreviewClick of memo1?

Thank you,

Reinaldo.

Re: Using FastReports FRH change memo2 from Memo1

PostPosted: Sun Apr 16, 2023 12:58 pm
by karinha

Re: Using FastReports FRH change memo2 from Memo1

PostPosted: Sun Apr 16, 2023 5:13 pm
by reinaldocrespo
Hello Karinha;

On that page the only memo that gets updated on the preview (refreshed using fwh language) is the one from which the mouse click event gets called, that is also the object for which the "modified" variable belongs to.

I'm thinking one possible way would be to alter the report engine object which is something I was hoping to avoid. The other way I think it would be possible would be to write a harbour function that finds the object and forces an update on the preview but that is something I'm also trying to avoid. I would rather if all code could all be contained on a script inside the report file (.fr3).

I really like FastReports. I think it is a shame there is no harbour api.

Thank you,