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:
cObjectcReportDirect Known Subclasses:
cReportDS, Class Definition
Properties
IntegerFind_Mode
only if No_Cfind_State
IntegerFooter_Lines
IntegerFound_Rec
old versions of the above, for compatibility sake it will be maintained
IntegerLast_Rec
IntegerMain_File
IntegerNo_Constrained_Find_State
IntegerNo_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.
IntegerNo_PageCheck_State
IntegerNo_Relate_State
only if No_Cfind_State
IntegerPage_Footer_Lines
IntegerpbChildReport
Internal Properties..maintained by object
IntegerpbFindDown
IntegerpbHasChildReports
IntegerpbRefindForSubTotal
Advanced use only
IntegerphMainReport
*** new property keeps track of who the main report is. Speeds things up
IntegerpiCurrentRecord
IntegerpiNumberBreaks
IntegerpiOrdering
let flex guess
IntegerpiRecordCount
RowIdpriCurrentRec
RowIdpriFoundRec
RowIdpriLastRec
Integerprivate.Assigned_Channel
Integerprivate.New_Page_State
needs new header
Integerprivate.Page_Count
Integerprivate.Page_End
-- these properties only need to be maintained by the
outermost report object..All children will operate on the parent
s/b set
Integerprivate.Page_End_State
needs end of page
Integerprivate.Page_Feed
s/b set *
Integerprivate.pbCanceled
Integerprivate.Report_Channel
s/b set **
IntegerReport_Footer_Lines
IntegerRpt_Ttl_Level
IntegerSub_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).
integerAssigned_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
IntegerDoRunReport()
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()
IntegerEnd_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
IntegerFind_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
IntegerHandle_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
IntegerHandle_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)
booleanIsRecnumTable(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)
integerNew_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
IntegerOnSelection()
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.
IntegerOnStartingMainReport()
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
IntegerOnStartingReport()
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
integerPage_Count()
integerPage_End()
IntegerPage_End_Check(Integer Lines)
Function: Page_End_Check (internal)
integerPage_End_State()
integerPage_Feed()
Page_Footer_set()
Page_total_Set()
integerpbCanceled()
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
integerReport_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)
IntegerSetup_Report()
Function_Setup Report
If a non-zero value is returned the report will not be run
IntegerTest_BreakPoints()
Function: Test_BreakPoints
A fairly complex override procedure gets automatically
created by the BREAK command line option or the REPORT_BREAKS
command.
IntegerTest_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
IntegerTest_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.
integerwhich_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):