Help with putting PK into Memo.TagStr - can't get it to work

hsmhsm
edited 12:18PM in FastReport 4.0
I have a simple banded report with dataset
frxDBDataSet1Bulletin
     NoteID
     Note
     Author
     ForGroup
NoteID is the PK. All fields are strings and all shown in the MasterData band

I want to pick up the noteID when I click on the Note memo box as part of making the report interactive. Following page 9 of the PM I put [frxDBDataset1Bulletin."NoteID"] in the TagStr property of the note memo box

Inside the TFrmPrintBulletin.frxReportBulletinDblClickObject event for the note memo box I have put
     
    TheNoteBox := frxReportBulletin.FindObject('frxDBDataset1BulletinNote1') as TfrxMemoView;
    TheNoteIDStr := TheNoteBox.TagStr; 
    showmessage(TheNoteIDStr); //get the ID of the note

However what gets shown in the message is the text [frxDBDataset1Bulletin."NoteID"] instead not it's value.

What am I doing wrong?

Comments

  • hsmhsm
    edited 12:18PM
    hsm wrote: »
    I have a simple banded report with dataset
    frxDBDataSet1Bulletin
         NoteID
         Note
         Author
         ForGroup
    
    NoteID is the PK. All fields are strings and all shown in the MasterData band

    I want to pick up the noteID when I click on the Note memo box as part of making the report interactive. Following page 9 of the PM I put [frxDBDataset1Bulletin."NoteID"] in the TagStr property of the note memo box

    Inside the TFrmPrintBulletin.frxReportBulletinDblClickObject event for the note memo box I have put
         
        TheNoteBox := frxReportBulletin.FindObject('frxDBDataset1BulletinNote1') as TfrxMemoView;
        TheNoteIDStr := TheNoteBox.TagStr; 
        showmessage(TheNoteIDStr); //get the ID of the note
    

    However what gets shown in the message is the text [frxDBDataset1Bulletin."NoteID"] instead not it's value.

    What am I doing wrong?


    OK Fixed it, so if anyone else has the same problem (or if I forget and come back here looking!)...

    The PM states
    hsm wrote: »
    After constructing a report, the ?«TagStr?» property contains values of the '1000;1'
    type, from which it is rather not difficult to get values of a key as well.
    but does not say how to actually get the value of a key.

    the answer is that on this occasion you don't have to point to the memo box using FindObject, you simply directly use the 'View' parameter that gets passed to the frxReportClickObject event and access its value by MyVar := view.tagstr;

    It appears that one must use the click event, not the dblclick as well.

  • gpigpi
    edited 12:18PM
    See InteractiveReport demo in Demos folder

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.