Help with interactive report please

hsmhsm
edited 2:07AM in FastReport 4.0
Following the instructions in the programmers manual section 1.10 (Interactive reports), I have placed a memo in a group header (Memo_A) and using the Tagstr property I am able to show a message with the group PK in it when it is clicked.

Now, like in the manual, I want to show an input box or a dialog but have whatever the user types put into another memo in the group header, Memo_B (NOT the one that was clicked). I can put the PK into that memo's TagStr as well but can't see how to refer to it in any way but its name.

What is the best way to refer to the memo_B that is in the same group header as that containing the memo_A that was clicked?

The code below works but it obviously puts the text into every instance of memo_B in every group header. I just want it in the Memo_B that is in header where I clicked Memo_A.

(Incidentally I had to alter the code from that shown in the manual and cast the Sender as a TfrxMemoView as the parameters of the OnClickObject you get in Delphi are different to those shown in the manual )

<!--fonto:Courier New--><span style="font-family:Courier New"><!--/fonto-->
procedure TForm1.frxReport1ClickObject( Sender: TfrxView;
                                        Button: TMouseButton;
                                        Shift: TShiftState;
                                    var Modified: Boolean);
var 
    MemoB: TfrxMemoView;

begin
 if TfrxMemoView(Sender).Name = 'Memo_A' then
      begin
      ShowMessage('PK:' + TfrxMemoView(Sender).Tagstr);   //debug line
      //get a reference to Memo_B <----- **** this bit needs correcting *****
      MemoB:= TfrxMemoView(frxReport1.FindObject('Memo_B'));
      MemoB.Text := InputBox('Edit', 'Enter Value',   'Default value');
      frxReport1.PrepareReport;
      end;
end;
<!--fontc--></span><!--/fontc-->

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.