Hi, Why have you used company as a dataitem? Have you added the fields in DataItemLink property on Purchase Header table? I am not sure you will be able to provide DataItemLink to the system in Purchase Header DataItem. You can do the following to achieve your desired output, - Remove all the dataitems from the report. - Declare Purchase Header and Company as record datatype global variables. - On the OnPreReport trigger, add this code, Company.RESET; IF Company.FINDSET THEN REPEAT PurchaseHeader.CHANGECOMPANY(Company.Name); IF PurchaseHeader.FINDSET THEN REPEAT // code to send data to excel ... UNTIL PurchaseHeader.NEXT = 0; UNTIL Company.NEXT = 0; Hope this helps.
↧