Hi
Method1:
SELECT "0" AS myHeader, a.myClient, a.whatever... , ;
SUM(b.myField1) AS myField1, ;
SUM(b.myField2) AS myField2 ;
FROM Table1 A, Table2 B ;
INTO CURSOR myCursor ;
WHERE a.myClient = b.myClient ;
AND.. other conditions ...if any ;
GROUP BY myClient ;
UNION ALL ;
SELECT "1" AS myHeader, a.myClient, a.whatever... , ;
b.myField1, b.myField2 ;
FROM Table1 A, Table2 B ;
WHERE a.myClient = b.myClient ;
AND.. other conditions ...if any ;
ORDER BY 2,1
Now you get a flat SQL cursor with the first record as your summary record and the rest of the records as your detailed record.
You have to output as a flat file.. i.e. sigle file report.
Take care that the report is grouped by client code and then by myHeader field in the cursor.. Also avoid the printing in detailed band if myHeader is "0".
Method2:
1. SELECT .. summery as above in Cursor1.
Index it on the Client code..
SET INDEX ORDER
2. Select the transactions from table 2.. as cursor2
Set the relation to cursor1
Output the report as master and child.. and summery info is available in cursor1.. so the solution..

ramani

(Subramanian.G),FoxAcc, ramani_g@yahoo.com