FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Using FastReports FRH change memo2 from Memo1
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
Using FastReports FRH change memo2 from Memo1
Posted: Sat Apr 08, 2023 02:22 PM
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 (fw): Select all Collapse
//--------------------------------------------------
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.
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Re: Using FastReports FRH change memo2 from Memo1
Posted: Sun Apr 16, 2023 12:58 PM
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
Re: Using FastReports FRH change memo2 from Memo1
Posted: Sun Apr 16, 2023 05:13 PM

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,

Continue the discussion