Re: A Brainteaser...
Posted in 1997
On 21 Jan 97, cranbourne@ndirect.co.uk (Glynn Huggins) wrote: >I am trying to write an ACE report to print an Invoice of one or two >64 line A4 pages. > >At line 40, a "Costs" section starts which should always be at this >position on the last page. > >The data befor line 40 may or may not be more than 39 lines long. >If it is, I need to print up to line 39, then skip to the top of the >next page and continue. > >I have tried all types of approach and so far failed. Anyone got an >idea? > >My report has a "before group of", an "on every row" and an "after >group of" section. > >The data is selected and arrays given values in the "on every row" >section. The data is tested to check the arrays contain data and then >printed by the "after group of" clause. > >My report is on the edge of being too large for ACE to handle so I >need to find an elegant solution. > >Please help! >Glynn > Dear Glynn, Below is the 4GL version ... MAIN LET line_cnt = 0 START REPORT .. OUTPUT TO REPORT ... FINISH REPORT END MAIN REPORT (...) BEFORE GROUP OF cost_section IF line_cnt = 0 THEN LET start_cnt = 1 SKIP TO TOP OF PAGE END IF ON EVERY ROW FOR array_cnt = start_cnt TO ... LET line_cnt = line_cnt + 1 PRINT data[array_cnt] .... IF line_cnt = 39 THEN LET line_cnt = 0 SKIP TO TOP OF PAGE END IF END FOR AFTER GROUP OF cost_section LET line_cnt = 0 END REPORT HTH. Regards > > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= _/_/_/_/ _/ _/ _/_/_/ Richard Wellis Sinyem _/ _/ _/ _/ _/ Company: Malitnet Consultancy Sdn Bhd _/ _/ _/ _/ _/ Tel: 082-415785 Fax: 082-428264 _/ _/ _/ _/ _/ _/_/_/_/ _/ _/ _/_/_/ E-Mail: sinyem@pc.jaring.my (home) _/ _/ _/ _/ _/ URL : http://www.malitnet.net.my _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/_/_/_/_/ _/_/_/ =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=