> SELECT bil01.* , ; > cli01.companyname, cli01.address1, cli01.address2, cli01.city, cli01.province, ; > TRANSFORM(cli01.postalcode,"@R "+country.mailmask) AS postalcode, cli01.countrycode, cli01.contactname ; > FROM bil01; > LEFT OUTER JOIN cli01 ; > ON bil01.cli01_fk = cli01.cli01_pk ; > LEFT OUTER JOIN country ; > ON cli01.countrycode = country.countrycode ; > WHERE invnumber IN (SELECT invoicenumber FROM invuplist) ; > ORDER BY invnumber ; > INTO CURSOR c_billstoprint > > SELECT c_billstoprint > INDEX ON bil01_pk TAG billkey > SET ORDER TO TAG billkey > > SELECT c_billstoprint.invnumber, lin01.*, price * quantity as extension ,; > tst01.testcode, tst01.description, ; > sup01.suppliercode, sup01.suppliername, sup01.location ; > FROM c_billstoprint ; > LEFT OUTER JOIN lin01 ; > ON c_billstoprint.bil01_pk = lin01.bil01_fk ; > LEFT OUTER JOIN tst01 ; > ON lin01.tst01_fk = tst01.tst01_pk ; > LEFT OUTER JOIN sup01 ; > ON lin01.sup01_fk = sup01.sup01_pk ; > ORDER BY bil01_fk, suppliername, clientname, description ; > INTO CURSOR c_linestoprint > > SELECT c_linestoprint > INDEX ON bil01_fk TAG billkey > SET ORDER TO TAG billkey > > SELECT bil01_fk, testcode, description, SUM(extension) AS testtotal, SUM(quantity) AS totalqty ; > FROM c_linestoprint ; > ORDER BY bil01_fk, testcode ; > GROUP BY bil01_fk, testcode, description ; > INTO CURSOR t_testtotals > > SELECT t_testtotals > INDEX ON bil01_fk TAG billkey > SET ORDER TO TAG billkey > > SELECT c_billstoprint > SET RELATION TO bil01_pk INTO c_linestoprint > SET RELATION TO bil01_pk INTO t_testtotals ADDITIVE > > > REPORT FORM "rbillprint.frx" PREVIEW > =MessageBox(PRINTINGSUMMARY_MSG, ; > MB_ICONEXCLAMATION + MB_OK, ; > PROCESSING_MSG) > > REPORT FORM "rbillsummary.frx" PREVIEW >