home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / DATABASE / PRN_LIB.ZIP / REPORT.PRG < prev    next >
Encoding:
Text File  |  1988-08-04  |  1.2 KB  |  59 lines

  1. ***
  2. ***  Report:  Sample Report
  3. ***
  4.  
  5. parameters a_model
  6.  
  7. if pcount() < 1
  8.   Prn_Init()         && Load the printer controls, using defaults
  9.   *                     unless PRINTER.MEM is around.
  10. else
  11.   Prn_Init(a_model)  && Try for a particular model
  12. endif
  13.                 
  14. PgHd_Init()
  15. declare header_[7]
  16. header_[1]= Large("BILL COLLECTING SYSTEM")
  17. header_[2]= Italic("Acme Corp, Inc. Ltd.")
  18. header_[3]= []  && Blank line
  19. header_[4]= Bold("People on the List")
  20. header_[5]= []
  21. header_[6]= Norm("Name        Address     Owes Us  $")
  22. header_[7]= Norm("----------  ----------  ----------")
  23.  
  24. total_owed= 0
  25.  
  26. select 1
  27. use DATA
  28. goto top
  29. do while .not. eof()
  30.   PageHead()
  31.   Norm_On()
  32.   NextLine(1, DATA->Name)
  33.   SameLine(2, DATA->Address)
  34.   if DATA->Owes_Us > 0
  35.     Bold_On()
  36.     SameLine(2, DATA->Owes_Us, "999,999.99")
  37.     Bold_Off()
  38.   else
  39.     SameLine(4, Italic("Paid up!"))
  40.   endif
  41.   total_owed= total_owed +DATA->Owes_Us
  42.   select DATA
  43.   skip
  44. enddo
  45. close databases
  46.  
  47. if prn_first
  48.   @ 10, 20 say "Nobody is on the list!"
  49. else
  50.   NextLine(2, "Total Owed to Us:")
  51.   SameLine(1, total_owed, "@B 999,999,999.99")
  52.   PrnEject()
  53.   PrintOff()
  54. endif
  55.  
  56. return
  57.  
  58. * eof Report.Prg
  59.