Join lines in 2 different records

I need to know all Purchase orders from a Vendor. The ones in Purchase Header ant the ones that are on Purch. Inv. Header already.

My problem is that when I select records on Purch. Inv. Header , I can get more than one invoice for the same purchase header, and in my report will appear the same Purchase order more than one time.

I woul like to join all lines of the same Purchase order in one order group of my report.

How can I do it?

DataItem Name
Vendor
Purchase Header
Purchase Line
Item
Purch. Inv. Header <Purch. Inv. Header>
Purch. Inv. Line <Purch. Inv. Line>
Integer
Integer Integer2

Use a temporary table on T38.