Class: cReport
if you want more increase this.
Class: Report
SuperClass: VConsole
Usage: Declaration syntax is:
Object <name> is a Report {MAIN_FILE <Main_File>} {BY|DOWN <Index>} ;
{BREAK ...... ** }
:
End_Object
Preferred Usage is:
Object <name> is a Report
Report_Main_File <Main_File>
Report_Index BY <Index>
Report_Breaks Brk_1 {..Brk_n}
:
End_Object
Class Hierarchy:
cObject

cReportDirect Known Subclasses:
cReportDS, Class Definition
Properties
Integer
Find_Mode
only if No_Cfind_State
Integer
Footer_Lines
Integer
Found_Rec
old versions of the above, for compatibility sake it will be maintained
Integer
Last_Rec
Integer
Main_File
Integer
No_Constrained_Find_State
Integer
No_Finding_State
Properties that can be set. All can be set with the SET command.
Some are set during the object (or sub-class) declaration.
Integer
No_PageCheck_State
Integer
No_Relate_State
only if No_Cfind_State
Integer
Page_Footer_Lines
Integer
pbChildReport
Internal Properties..maintained by object
Integer
pbFindDown
Integer
pbHasChildReports
Integer
pbRefindForSubTotal
Advanced use only
Integer
phMainReport
*** new property keeps track of who the main report is. Speeds things up
Integer
piCurrentRecord
Integer
piNumberBreaks
Integer
piOrdering
let flex guess
Integer
piRecordCount
RowId
priCurrentRec
RowId
priFoundRec
RowId
priLastRec
Integer
private.Assigned_Channel
Integer
private.New_Page_State
needs new header
Integer
private.Page_Count
Integer
private.Page_End
-- these properties only need to be maintained by the
outermost report object..All children will operate on the parent
s/b set
Integer
private.Page_End_State
needs end of page
Integer
private.Page_Feed
s/b set *
Integer
private.pbCanceled
Integer
private.Report_Channel
s/b set **
Integer
Report_Footer_Lines
Integer
Rpt_Ttl_Level
Integer
Sub_Totaling_State
Functions and Procedures

Assign_Report_Channel()
Procedure: Assign_Report_Channel
This makes sure the the correct channel is set. This called by
the report's critical entry points (DoRunReport,
Handle_report_Line, End_report).
integer
Assigned_Channel()

Breaks_Set()
these procedures get created during object or class creation.
They will create handlers that set the value of the
associated properties. This allow this package to be used
for class construction.

Clear_Breakpoints()
05/18/95 - When a report is started all breakpoints should be
cleared.

Constrain()
intended for override/augmentation

Construct_Object()
Integer Img
Integer
DoRunReport()
Function: DoRunReport
Main entry point for report. It has two operation modes:
1. If NO_FINDING_STATE is False (the default when MAIN_FILE is
set) then this runs the entire report.
2. If NO_FIND_STATE is True because it was set that way or
MAIN_FILE was never set then this initializes the report and
returns. You then run the report by sending it
Handle_Report_Line messages and then ending it with a
End_Report message
Main Logic:
Get Setup_Report <--- initializes report
If a full report begin
Repeat
Get Handle_Report_Line <-- finds and prints a line
until the report is ended or cancelled
get End_Report <--- ends the report
end
Function_Return Report_status

End_Construct_Object()
Integer
End_Report(Integer Rpt_Status)
Function: End_Report
Called to shut down the report.
Pass: Rpt_Status - If Rpt_Status=RPT_CANCEL then the report was
cancelled.
Main_Logic
If Rpt_Status ne RPT_CANCEL <---normal end of report
send Handle_End_Report <---final subtotals, totals, etc
Move RPT_OK to Rpt_Status <---we want a normal report to end
with a RPT_OK
Else
Send Handle_Cancelled_Report
send OnEndingReport
If main outer report send OnEndingMainReport
return Rpt_Status

Filler()
print 1 filler line as needed

Final_FormFeed()
Procedure Final_Formfeed
intended for augmentation/override
Called to eject the last page after the main report has
processed all records.

Find_Init()
record finding support
Procedure: Find_Init
set up this file for finding... This clears the needed buffers
Integer
Find_Rec()
Function: Find_Rec
This is the reports main record finding procedure
Ret : Integer RPT_OK or RPT_END (plus record in buffer)
This is the routine to augment or override to handle Custon Finding.
If a record is returned we must set the property Found_Rec to the
record number. Remember this if you override this routine!

FormFeed()
Procedure FormFeed
intended for augmentation/override
Formfeed is responsible for handling an end of page break
AND incrementing the property Page_Count AND zeroing the
integer LINECOUNT

Handle_Cancelled_Report()
Procedure: Handle_Cancelled_Report
Shut down a cancelled report. This prints the final formfeed if
anything was printed and the report was not a screen report and
it is the main outer report.

Handle_End_Report()
Procedure: Handle_End_Report
Shut down report in normal manner. Print final subtotals, totals
and footers

Handle_Footer(Integer LastTime)
Procedure: Hanle_Footer (Internal)
Do Filler and footer
Integer
Handle_KeyPressed()
Function: Handle_KeyPressed
This message is delegated to the outermost parent. It then
calls the function Test_Keypressed. If Test_KeyPressed returns
a non-zero value it will set pbCanceled to TRUE and
return RPT_CANCEL
Integer
Handle_Report_Line()
Function: Handle_Report_Line
Handle 1 line of a report doing headers,totals as needed.
Returns Integer Rpt_Status as what happened (RPT_OK-Record found and
printed, RPT_END-Record not found/end report, RPT_CANCEL-report
has been cancelled, RPT_NOT_SELECT - (special) means current
record was not valid - but keep looking
If NO_FINDING_STATE is TRUE then you should call this function
with a record already in place. Otherwise this will find the
record for you.

Handle_SubHeaders(Integer CBrk)
Procedure: Handle_SubHeaders (Internal)

Handle_SubTotals(Integer CBrk)
Procedure: Handle_SubTotals (Internal)
boolean
IsRecnumTable(integer iFile)

Mark_as_Rpt_Child()

Mark_Main_Report_Id(Integer Obj#)
Mark this child report object's Main report Id along with all of
its children

Mark_Rpt_Children()

New_Page()
Procedure: New_Page (internal)
integer
New_Page_State()

OnBody()
Procedure: OnBody
Normally this is overridden. In nested reports this can be sued
by the parent to start all of the inner reports.

OnConstrain()
added optional support for OnConstrain

OnEndingMainReport()
Procedure: OnEndingMainReport
User Handler Intended for override. This is the same as
OnEndingReport except this message is only sent to the main
(parent) outer report. Nested reports do not send this message.
This is very useful for closing files, io channels, etc.

OnEndingReport()
Procedure: OnEndingReport
User Handler Intended for override. This is called by end_report
for all reports. If the report is nested this IS called every
time the nested report is entered.

OnPageBottom()
last thing printed on every page

OnPageFooter()
Printed after OnPageTotal every page but last

OnPageHeader()
Printer after OnPageTop..Every page but 1st.

OnPageTitle()
Printed after OnPageHeader or OnReportHeader

OnPageTop()
Page break related procedures. Note that the procedure names are
identical in name and function as their FlexQL counterparts.
Procedures onPageTop thru OnPageBottom ONLY get used by the outermost report
object... All other objects delegate messages to this ultimate parent.
creating these procedures in child reports will have NO effect.
Printed at the Top of EVERY page

OnPageTotal()
Printed at end of each page

OnReportFooter()
Printed after OnPageTotal last page only

OnReportHeader()
Printed after OnPageTop..First Page ONLY
Integer
OnSelection()
Function: OnSelection
returns: Rpt_Status
Called after a record has been found. Intended for override. If
you are using constraints you probably won't need this.
Integer
OnStartingMainReport()
Function: OnStartingMainReport
User Handler Intended for override. This is the same as
OnStartingReport except this message is only sent to the main
(parent) outer report. Nested reports do not send this message.
This is very useful for setting indexes, output channels, etc.
If a non-zero value is returned the report will be cancelled
Pre report prep. For Override by user
Integer
OnStartingReport()
Function: OnStartingReport
User Handler Intended for override. This is called by setup
for all reports. If the report is nested this IS called every
time the nested report is entered.
If a non-zero value is returned the report will be cancelled
Pre report prep. For Override by user

OnSubHeader1()

OnSubHeader2()

OnSubHeader3()

OnSubHeader4()

OnSubHeader5()

OnSubHeader6()

OnSubHeader7()

OnSubHeader8()

OnSubHeader9()

OnSubHeaderInit1()

OnSubHeaderInit2()

OnSubHeaderInit3()

OnSubHeaderInit4()

OnSubHeaderInit5()

OnSubHeaderInit6()

OnSubHeaderInit7()

OnSubHeaderInit8()

OnSubHeaderInit9()

OnSubTotal1()

OnSubTotal2()

OnSubTotal3()

OnSubTotal4()

OnSubTotal5()

OnSubTotal6()

OnSubTotal7()

OnSubTotal8()

OnSubTotal9()

OnTotal()
Procedure: OnTotal
Called at the end of the report. Intended for override.

Output_ImageNum(Integer ImageNum)
Procedure: OutPut_ImageNum
Possibly useful for override and augmentation in that all
image output goes through this handler.

OutPut_PageCheck(Integer ImageNum Integer Lines)
Procedure: OutPut_PageCheck (internal)

OutPut_Wrap_PageCheck(Integer ImageNum Integer Lines Integer PrintReq)
Output_Wrap_PageCheck (internal)
06-17-1992 added PrintReq as parameter. If true print line always
05/18/95 it is possible for |122 to get clobbered (with increment
ifchange or for commands). Push and pop it first.

Page_bottom_Set()

Page_Check(Integer Lines)
Procedure: Page_Check (internal)
check if room for new image..if not new page
integer
Page_Count()
integer
Page_End()
Integer
Page_End_Check(Integer Lines)
Function: Page_End_Check (internal)
integer
Page_End_State()
integer
Page_Feed()

Page_Footer_set()

Page_total_Set()
integer
pbCanceled()

ReadByRowId(RowId riID)
Procedure : ReadByRowId
Find a record by its rowId number. Used by the report object
to refind records

Rebuild_Constraints()

Relate_Main_File()
//
// Procedure : Read_By_RecNum
// Find a record by its record number. Used by the report object
// to refind records
//
Procedure Read_By_Recnum Integer Rec#
integer iFile
// Get main_file to Filenumber
// If (Filenumber<>0 AND Rec#<>0) begin
// Move 0 to fieldindex
// Move Rec# to Indirect_File.RECNUM
// Find eq Indirect_File.RECNUM
Get main_file to iFile
If (iFile<>0 AND Rec#<>0) begin
Set_Field_value iFile 0 to Rec#
VFind iFile 0 eq
[Found] Begin
// If Not (No_Constrained_Find_State(self) and ;
// No_Relate_State(self)) Relate Indirect_File
If Not (No_Constrained_Find_State(self) and ;
No_Relate_State(self)) Relate iFile
Send Relate_Main_File // custom relate records
Indicate Found True
End
End
Else Indicate Found False
End_procedure
Procedure Relate_Main_File
Called when custom relates are needed in a report. Intended
for Override
for override
integer
Report_Channel()

Report_Footer_Set()

RePrint_SubHeaders()
Procedure: RePrint_SubHeaders (Internal)
RePrint SubHeaders as part of a page break

Restore_Parent_Rec()
Procedure: Restore_Parent_Rec

Run_Report()
Procedure: Run_Report
This runs an entire report. It is just like DoRunReport except that it
does not return a value. If you use this then you will not know how the
report was ended. On the up side the syntax is clearer. DO NOT use this
with external (no_find_State) reports.

SET(integer Val)

SET(integer Val)

SET(integer Val)

SET(integer Val)

SET(integer Val)

SET(integer Val)

SET(integer Val)

SET(integer Val)
Integer
Setup_Report()
Function_Setup Report
If a non-zero value is returned the report will not be run
Integer
Test_BreakPoints()
Function: Test_BreakPoints
A fairly complex override procedure gets automatically
created by the BREAK command line option or the REPORT_BREAKS
command.
Integer
Test_KeyPressed()
Function: Test_KeyPressed
This returns a 1 if any key is pressed which will cause a
report to be cancelled. This is not a very simple handler and
is inteded for override.
0 - ok 1 - abort
Integer
Test_One_BreakPoint(Integer BNum String BStr Integer Arr# Integer CBreak Integer RCount)
Function: Test_One_BreakPoint
Pass: BNum - current breakpoint number to test
BStr - New breakpoint value to test
Arr# - Object ID# of breakpoint array
CBreak - Current highest breakpoint which has been
already triggered (0-none, 1-highest, n-lowest).
RCount - Current Record Count (piRecordCount).
Return: Highest breakpoint set.
This function is called by Test_BreakPoints for each
breakpoint item that needs testing. It must set the highest
break level and place the current break value in the break
array.
integer
which_index(integer file# integer field#)
returns index# (incl. 0) or 0 if unindexed/error

WriteLn(String WrStr)
Procedure: Writeln
Possibly useful for override and augmentation in that all
non image writeln goes through this handler.

Writeln_PageCheck(String WrStr Integer Lines)
Procedure: Writeln_PageCheck (Advanced use)
Instances
oEvalObj | cInternetSessionBusinessProcess.pkg | 88 |
References (1):