Select Count(*) From Billcompress Where Alltrim(PS)="U1" Into Array NewHeaderpagecount && Counts the Number of Pages Goto 4 cBillcompressedpage="%%Pages: "+Alltrim(Str(NewHeaderpagecount)) Replace PS With cBillcompressedpage lcStr = Strtran(lcStr, "&Oldheaderpagecount", "&cBillcompressedpage") Locate For Alltrim(PS)="U1" Skip-5 Insert Blank Pagenumber='F8 (Page No. 1 of '+Alltrim(Str(NewHeaderpagecount))+')500 10 w' Replace PS With Pagenumber For I=2 To NewHeaderpagecount NeXTTEXT='%%Page: '+Alltrim(Str(I+1))+" "+Alltrim(Str(I+1)) Locate For PS=NeXTTEXT Replace PS With 'F8 (Page No. '+Alltrim(Str(I))+' of '+Alltrim(Str(NewHeaderpagecount))+')500 10 w' ENDFORThe detail are as follows:-
F11 (Total Charges \(Rs.\))32 561 w (62.72)381 561 x 14 477 T M 90 O g n M -90 O -14 -477 T G U1 g n F1 B (Account Number 1021337392)27 789 w G g n F1 B (Invoice Number 10213373920005)566 789 x U1 G E 16 606 75 -12 i B 90 594 16 594 L /F14{/I 6.3 Fn2}b F14 (STD)18 597 w E 90 606 43 -12 i 0 -72 6.03 mul translate /F14{/I 6.3 Fn2}b F14 (STD)18 597 w E 90 606 43 -12 i 0 -72 6.03 mul translate F14 (STD)18 597 w E 90 606 43 -12 i U1I need the inserted records as:-
F11 (Total Charges \(Rs.\))32 561 w (62.72)381 561 x F8 (Page No 1 of 5)+')500 10 w' && New record inserted prior to 5 records before U1 14 477 T M 90 O g n M -90 O -14 -477 T G U1 F11 (Total Charges \(Rs.\))32 561 w (62.72)381 561 x F8 (Page No 2 of 5)+')500 10 w' && New record inserted prior to 5 records before U1 g n F1 B (Account Number 1021337392)27 789 w G g n F1 B (Invoice Number 10213373920005)566 789 x U1 G E 16 606 75 -12 i B 90 594 16 594 L /F14{/I 6.3 Fn2}b F14 (STD)18 597 w E 90 606 43 -12 i F8 (Page No 3 of 5)+')500 10 w' && New record inserted prior 0 -72 6.03 mul translate 0 -72 6.03 mul translate /F14{/I 6.3 Fn2}b F14 (STD)18 597 w E 90 606 43 -12 i 0 -72 6.03 mul translate && No Records inserted since the already inserted in the first instance between two U1 F14 (STD)18 597 w E 90 606 43 -12 i U1 G B 90 594 16 594 L /F14{/I 6.3 Fn2}b F8 (Page No 4 of 5)+')500 10 w' && New record inserted prior to 5 records before U1 E 16 606 75 -12 i B 90 594 16 594 L /F14{/I 6.3 Fn2}b F14 (STD)18 597 w E 90 606 43 -12 i U1 G B 90 594 16 594 L /F14{/I 6.3 Fn2}b F8 (Page No 4 of 5)+')500 10 w' && New record inserted prior to 5 records before U1 E 16 606 75 -12 i B 90 594 16 594 L /F14{/I 6.3 Fn2}b F14 (STD)18 597 w E 90 606 43 -12 i U1