>Can somebody please help me. I need to do a rather complicated report.
>
>I have 2 tables in a parent and child relationship. When I print the report however, I use the child as the parent and the parent as the child (as I read in the manual, that is recommended way). I group on the document number. I will only ever print one document at a time (almost like an invoice print).
>
>However, in certain instances, there are some detail, stored in another table that I need to print at the end of the group. It will never be more than 4 or 5 rows so I thought I could try to read the detail into an array and print the array at the end of the group. This other table will also have the same document number as a key.
>
>But this is exactly my problem. I tried to read the detail into report variables in the OpenTables event of the Dataenvironment but it seems to clear the report variables before it starts printing. What I need to do is put some code in the group footer section of the report but nowhere in the manual can I find anything on this.
>
>How can I print this detail at the end of a group in the same report ? Is it possible at all ?
You can put your code into a user defined function (in a .PRG) and then call this from an expression in the group footer of your report (maybe passing the document_id as a parameter). The function can then gather the information that you need to print and return it as a block of text (use chr(13) to add new lines in the text). If returning multiple lines, make sure that the report field is allowed to 'stretch with overflow'