Select Count(*) From Billcompress Where Alltrim(PS)="U1" Into Array NewHeaderpagecount 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 record U1 in post script means show page command i.e if suppose I insert the text ‘F8 (Page 1 of 5) 500 10 w’ before(5 records Before) U1, Page 1 of 5 will be displayed at the footer of Page 1.
F12 (Penalty For Late Payments Made)32 571 w (62.72)382 570 x F11 (Total Charges \(Rs.\))32 561 w ‘F8 (Page 1 of 5) 500 10 w’ && Footer Inserted (62.72)381 561 x 14 477 T M 90 O g n M -90 O -14 -477 T G U1 && End of Page 1 F12 (Penalty For Late Payments Made)32 571 w (62.72)382 570 x F11 (Total Charges \(Rs.\))32 561 w ‘F8 (Page 2 of 5) 500 10 w’ && Footer Inserted (62.72)381 561 x 14 477 T M 90 O g n M -90 O -14 -477 T G U1 && End of Page 2However, the above has an exception, It in between two U1, there is a text '0 -72 &Prefixmul mul translate', the footer should be placed immediately before the first occurrence of this text and not before the U1. Only Just once before the first occurrence of this text between two U1.
F12 (Penalty For Late Payments Made)32 571 w (62.72)382 570 x F11 (Total Charges \(Rs.\))32 561 w ‘F8 (Page 1 of 5) 500 10 w’ && Footer Inserted (62.72)381 561 x 14 477 T M 90 O g n M -90 O -14 -477 T G U1 && End of Page 1 F12 (Penalty For Late Payments Made)32 571 w (62.72)382 570 x F11 (Total Charges \(Rs.\))32 561 w ‘F8 (Page 2 of 5) 500 10 w’ && Footer Inserted (62.72)381 561 x 14 477 T M 90 O g n M -90 O -14 -477 T G U1 && End of Page 2 F12 (Penalty For Late Payments Made)32 571 w (62.72)382 570 x 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 ‘F8 (Page 3 of 5) 500 10 w’ && Footer Inserted 0 -72 &Prefixmul mul translate && F12 (Penalty For Late Payments Made)32 571 w (62.72)382 570 x F11 (Total Charges \(Rs.\))32 561 w 0 -72 &Prefixmul mul translate && No Footer Insertion required. F12 (Penalty For Late Payments Made)32 571 w (62.72)382 570 x F11 (Total Charges \(Rs.\))32 561 w (62.72)381 561 x U1