Using comment lines in reports

I am writing a Report that references the comment line for a Prospect,Contact and Activity. Because I cannot have the DataItem “Cont. Mgt. Comment Line” referenced more than once I am using a Global variable field for the comment and date and in the cal code defining the values: Cmnt.SETRANGE(“Table Name”,Cmnt.“Table Name”::Prospect); Cmnt.SETRANGE(“Prospect No.”,Prospect.“No.”); IF Cmnt.FIND(’-’) THEN REPEAT CmntText := Cmnt.Comment; CmntDate := Cmnt.Date; UNTIL Cmnt.NEXT = 0; But only the last comment appears on my report. I know it is going through the comment lines because if I use the Message command it brings me through the comments. I have then tried defining an Integer as my dataitem. This checks the number of comment lines for the prospect and loops through the lines to display the comments. This way if I have 3 comment lines it displays the last line 3 times instead of each line. Any ideas?

Hi, You can have the “Cont. Mgt. Comment Line” table as a DataItem more than once in a Report. But then you have to change it’s name. You cannot use the default name or there will be the same variable name used more than once. Then you can simply use the sections of this DataItem to print the fields you need, as usual. Good luck. PS: Shouldn’t this be in the Developer’s forum?

That worked. Many thanks. Sorry about using the wrong forum. First time posting something

Glad I could help, best regards