Class: Report
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:
cObjectReportDirect Known Subclasses:
Report_DS, Class Definition
Properties
IntegerChild_Rpt_State
Internal Properties..maintained by object
IntegerCurrent_Rec
IntegerFind_Down_State
IntegerFind_Mode
only if No_Cfind_State
IntegerFooter_Lines
IntegerFound_Rec
old versions of the above, for compatibility sake it will be maintained
IntegerHas_Children_Rpt_State
IntegerLast_Rec
IntegerMain_File
IntegerMain_Report_Id
*** new property keeps track of who the main report is. Speeds things up
IntegerNo_Constrained_Find_State
IntegerNo_Finding_State
use default delegation_mode Sat 11-21-1992
**Set Delegation_Mode to NO_DELEGATION // we DO NOT delegate to Parent objects!
Set Focus_mode to no_activate // should never take the focus
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
IntegerNum_Breaks
IntegerOrdering
let flex guess
IntegerPage_Footer_Lines
RowIdpriCurrentRec
RowIdpriFoundRec
RowIdpriLastRec
Integerprivate.Assigned_Channel
Integerprivate.Cancelled_State
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.Report_Channel
s/b set **
IntegerRec_Count
IntegerRefind_For_SubTotal_State
Advanced use only
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 (start_Report,
Handle_report_Line, End_report).
integerAssigned_Channel()
Body()
Procedure: Body
Normally this is overridden. In nested reports this can be sued
by the parent to start all of the inner reports.
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.
integerCancelled_State()
Clear_Breakpoints()
05/18/95 - When a report is started all breakpoints should be
cleared.
Constrain()
intended for override/augmentation
Construct_Object()
Integer Img
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 Ending_Report
If main outer report send Ending_Main_report
return Rpt_Status
Ending_Main_Report()
Procedure: Ending_Main_Report
User Handler Intended for override. This is the same as
Ending_report 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.
Ending_Report()
Procedure: Ending_Report
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.
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 priFoundRec 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 cancelled_state 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()
OnConstrain()
added optional support for OnConstrain
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()
last thing printed on every page
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()
Printed after Page_Total every page but last
Page_Footer_set()
Page_Header()
Printer after Page_Top..Every page but 1st.
Page_Title()
Printed after Page_Header or Report_Header
Page_Top()
Page break related procedures. Note that the procedure names are
identical in name and function as their FlexQL counterparts.
Procedures Page_Top thru Page_Bottom 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
Page_Total()
Printed at end of each page
Page_total_Set()
ReadByRowId(RowId riID)
Procedure Read_By_Recnum RowId Rec#
integer iFile
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 iFile
Send Relate_Main_File // custom relate records
Indicate Found True
End
End
Else Indicate Found False
End_procedure
Procedure : ReadByRowId
Find a record by its rowId number. Used by the report object
to refind records
Rebuild_Constraints()
Relate_Main_File()
Procedure Relate_Main_File
Called when custom relates are needed in a report. Intended
for Override
for override
integerReport_Channel()
Report_Footer()
Printed after Page_Total last page only
Report_Footer_Set()
Report_Header()
Printed after Page_Top..First Page ONLY
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 start_report 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.
IntegerSelection()
Function: Selection
returns: Rpt_Status
Called after a record has been found. Intended for override. If
you are using constraints you probably won't need this.
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
IntegerStart_Report()
Function: Start_Report
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
IntegerStarting_Main_Report()
Function: Starting_Main_Report
User Handler Intended for override. This is the same as
Starting_report 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
IntegerStarting_Report()
Function: Starting_Report
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
SubHeader1()
SubHeader2()
SubHeader3()
SubHeader4()
SubHeader5()
SubHeader6()
SubHeader7()
SubHeader8()
SubHeader9()
SubHeader_Init1()
SubHeader_Init2()
SubHeader_Init3()
SubHeader_Init4()
SubHeader_Init5()
SubHeader_Init6()
SubHeader_Init7()
SubHeader_Init8()
SubHeader_Init9()
SubTotal1()
SubTotal2()
SubTotal3()
SubTotal4()
SubTotal5()
SubTotal6()
SubTotal7()
SubTotal8()
SubTotal9()
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 (rec_Count).
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.
Total()
Procedure: Total
Called at the end of the report. Intended for override.
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):