DEFINITION MODULE Reports; (*$VER 0.9(101)*) (* ---------------------------------------------------------------------- Copyright 1988 (c) by Highlander Software Group. All Rights Reserved Title: Report Library Module Definition Module Purpose: This library module defines the Report ADT, or object, and a set of procedures for manipulating reports. All of the functions required for crearting, formating and disposing of report objects are provided. History: 0.9 100 10/01/88 MTM Original version. 101 11/14/88 MTM Added NewLine & NoBreakBar constant. ---------------------------------------------------------------------- *) (*--- LIBRARY IMPORT DEFINITIONS ---*) FROM SYSTEM IMPORT ADDRESS; (* Address TYPE - requires 4 bytes *) (*--- CONSTANT DEFINITIONS ---*) CONST NewLine = 0; Total = 1; Average = 2; Maximum = 3; Minimum = 4; Count = 5; Right = 6; Left = 7; Center = 8; ZeroFill = 9; BlankFill = 10; NoBreakBar = 15; (*--- TYPE DEFINITIONS ---*) TYPE Report; (* Report Abstract Data Type *) DataType = (String,Float,Binary,Cardinal,LongCard,Integer,LongInt, Real,LongReal,Char,Boolean,Date,Time,MMDDYY,YYMMDD); (*--- PROCEDURE DEFINITIONS ---*) (*+----------------------------------------------------------------------+ | | | Procedure: OpenReport | | | | Purpose: The OpenReport procedure creates a `Report-Object' | | and stores its specifications. This procedure may | | be executed any number of times. Each execution | | creates a new and seperate `Report-Object'. The | | parameter `rep' represents the report just opened. | | All of the other procedures in this library require | | this parameter to determine which report is being | | processed. | | | | Usage: VAR | | cuslist: Report; | | result: CARDINAL; | | BEGIN | | OpenReport(cuslist,"Customer List","LASER", | | "CUSTMR.LST",2,TRUE,"GRNBAR",80,66, | | 2,result); | | | | Results: 0 = Successful completion. | | 1 = Unable to open text stream for report output. | | | | Remarks: All null printer name will bypass spooling report. | | | +----------------------------------------------------------------------+*) PROCEDURE OpenReport( (* Open Report for processing *) (*-----------Parameters-----------*) VAR rep: Report; (* Report ADT *) title: ARRAY OF CHAR; (* Title for report *) printer: ARRAY OF CHAR; (* Printer to spool output to *) name: ARRAY OF CHAR; (* Name of disk file for output *) copies: CARDINAL; (* Number of copies of report *) delete: BOOLEAN; (* Delete disk file after spool *) form: ARRAY OF CHAR; (* Form name for report *) linewidth: CARDINAL; (* Width of report line *) lineperpg: CARDINAL; (* Number of lines per page *) colgap: CARDINAL; (* Inter column spacing *) VAR result: CARDINAL (* Result returned from procedure *) ); (*+----------------------------------------------------------------------+ | | | Procedure: CloseReport | | | | Purpose: The CloseReport procedure terminates processing for | | specified `Report-Object', closes the output text | | file, spools the file to a printer and destroys the | | `Report-Object'. | | | | Usage: VAR | | cuslist: Report; | | result: CARDINAL; | | BEGIN | | CloseReport(cuslist,result); | | | | Results: 0 = Successful completion. | | # = Unable to close text stream for report output. | | | | Remarks: None | | | +----------------------------------------------------------------------+*) PROCEDURE CloseReport( (* Close Report & spool output *) (*-----------Parameters-----------*) VAR rep: Report; (* Report ADT *) VAR result: CARDINAL (* Result returned from procedure *) ); PROCEDURE DefineHeader( (* Add line of text to report Hdr *) (*-----------Parameters-----------*) rep: Report; (* Report ADT *) text: ARRAY OF CHAR; (* Text line for header display *) options: BITSET; (* Display options for text *) VAR result: CARDINAL (* Result returned from procedure *) ); PROCEDURE ClearHeader( (* Clear all header text for Rpt. *) (*-----------Parameters-----------*) rep: Report; (* Report ADT *) VAR result: CARDINAL (* Result returned from procedure *) ); PROCEDURE DefineLegend( (* Add line of text to Rpt Legend *) (*-----------Parameters-----------*) rep: Report; (* Report ADT *) text: ARRAY OF CHAR; (* Text line for legend display *) options: BITSET; (* Display options for text *) VAR result: CARDINAL (* Result returned from procedure *) ); PROCEDURE ClearLegend( (* Clear all legend text from Rpt *) (*-----------Parameters-----------*) rep: Report; (* Report ADT *) VAR result: CARDINAL (* Result returned from procedure *) ); PROCEDURE DefineTrailer( (* Add line of text to Rpr Trailer*) (*-----------Parameters-----------*) rep: Report; (* Report ADT *) text: ARRAY OF CHAR; (* Text line for report tariler *) options: BITSET; (* Display options for text *) VAR result: CARDINAL (* Result returned from procedure *) ); PROCEDURE ClearTrailer( (* Clear all trailer text from Rpt*) (*-----------Parameters-----------*) rep: Report; (* Report ADT *) VAR result: CARDINAL (* Result returned from procedure *) ); PROCEDURE PrintLine( (* Include give line into report *) (*-----------Parameters-----------*) rep: Report; (* Report ADT *) line: ARRAY OF CHAR; (* Line of output for report *) options: BITSET; (* Display options for line *) VAR result: CARDINAL (* Result returned from procedure *) ); PROCEDURE DefineColumn( (* Define column for report *) (*-----------Parameters-----------*) rep: Report; (* Report ADT *) addr: ADDRESS; (* Address of column variable *) type: DataType; (* Data type of column variable *) width: CARDINAL; (* Width of column in report *) mask: ARRAY OF CHAR; (* Display mask for column *) title: ARRAY OF CHAR; (* Column header text *) options: BITSET; (* Display/action options *) VAR result: CARDINAL (* Result returned from procedure *) ); PROCEDURE FormatLine( (* Format report line by columns *) (*-----------Parameters-----------*) rep: Report; (* Report ADT *) VAR result: CARDINAL (* Result returned from procedure *) ); PROCEDURE FormatSubTotals( (* Format subtotal for report *) (*-----------Parameters-----------*) rep: Report; (* Report ADT *) title: ARRAY OF CHAR; (* Title for subtotal line *) column: CARDINAL; (* Display column for title *) VAR result: CARDINAL (* Result returned from procedure *) ); PROCEDURE FormatTotals( (* Format total for report *) (*-----------Parameters-----------*) rep: Report; (* Report ADT *) title: ARRAY OF CHAR; (* Title for total line *) column: CARDINAL; (* Display column for title *) VAR result: CARDINAL (* Result returned from procedure *) ); PROCEDURE FormatGrandTotals( (* Format grand totals for report *) (*-----------Parameters-----------*) rep: Report; (* Report ADT *) title: ARRAY OF CHAR; (* Title for grand total line *) column: CARDINAL; (* Display column for title *) VAR result: CARDINAL (* Result returned from procedure *) ); PROCEDURE StartNewPage( (* Force start of new page on Rpt *) (*-----------Parameters-----------*) rep: Report (* Report ADT *) ); PROCEDURE EndCurrentPage( (* Finish current page on Rpt *) (*-----------Parameters-----------*) rep: Report (* Report ADT *) ); (*--- END OF LIBRARY MODULE ---*) END Reports.