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
Construct_Object()
Integer Img
- Make$Private$Set_Get
These routines let you set and Get the private properties.
In all cases the Get or Set is delegated to the ultimate parent
SET(integer Val)
- Integer
Obj#
- integer
Page_End()
- Integer
retval - Integer
Obj#
SET(integer Val)
- Integer
Obj#
- integer
New_Page_State()
- Integer
retval - Integer
Obj#
SET(integer Val)
- Integer
Obj#
- integer
Page_End_State()
- Integer
retval - Integer
Obj#
SET(integer Val)
- Integer
Obj#
- integer
Page_Feed()
- Integer
retval - Integer
Obj#
SET(integer Val)
- Integer
Obj#
- integer
pbCanceled()
- Integer
retval - Integer
Obj#
SET(integer Val)
- Integer
Obj#
- integer
Page_Count()
- Integer
retval - Integer
Obj#
SET(integer Val)
- Integer
Obj#
- integer
Report_Channel()
- Integer
retval - Integer
Obj#
SET(integer Val)
- Integer
Obj#
- integer
Assigned_Channel()
- Integer
retval - Integer
Obj#
- Make$Procs
---Create all the default Message handlers for all Sections. These all do
nothing and are intended for override
This will make routines for all OnSubHeaderInit, OnSubHeader, and
OnSubTotal Procedures. They all do nothing and are intended for
override.
Procedure: OnSubHeaderInit1..n
This is called when a new subheader is started. It is
called only once for each new subheader. It is not called when
subheaders are printed during a page break.
Procedure: OnSubHeader1..n
This is called each time a subheader needs to be printed -
both the first time a subheader is printed and during the
reprinting of subheaders during page breaks.
Procedure: OnSubTotal1..n
This is called when a subtotal needs to be processed
Procedure_Name Crnt_Num End_Num
OnSubHeader1()
OnSubHeader2()
OnSubHeader3()
OnSubHeader4()
OnSubHeader5()
OnSubHeader6()
OnSubHeader7()
OnSubHeader8()
OnSubHeader9()
OnSubTotal1()
OnSubTotal2()
OnSubTotal3()
OnSubTotal4()
OnSubTotal5()
OnSubTotal6()
OnSubTotal7()
OnSubTotal8()
OnSubTotal9()
OnSubHeaderInit1()
OnSubHeaderInit2()
OnSubHeaderInit3()
OnSubHeaderInit4()
OnSubHeaderInit5()
OnSubHeaderInit6()
OnSubHeaderInit7()
OnSubHeaderInit8()
OnSubHeaderInit9()
OnTotal()
Procedure: OnTotal
Called at the end of the report. Intended for override.
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
OnReportHeader()
Printed after OnPageTop..First Page ONLY
OnPageHeader()
Printer after OnPageTop..Every page but 1st.
OnPageTitle()
Printed after OnPageHeader or OnReportHeader
OnPageTotal()
Printed at end of each page
OnPageFooter()
Printed after OnPageTotal every page but last
OnReportFooter()
Printed after OnPageTotal last page only
OnPageBottom()
last thing printed on every page
- boolean
IsRecnumTable(integer iFile)
- Boolean
bRecnumTable
- 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
Rpt_Status
- 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_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_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
retval - Integer
Is_Break - String
Ch_0 - String
Ch_255
Find_Init()
record finding support
Procedure: Find_Init
set up this file for finding... This clears the needed buffers
- Integer
File# - Integer
Ndx# - Integer
Mode
- 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!
- Integer
Mode - Integer
iFile - Integer
iRec
ReadByRowId(RowId riID)
Procedure : ReadByRowId
Find a record by its rowId number. Used by the report object
to refind records
- Integer
iFile - Boolean
bFound
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
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
- Integer
Rpt_Status - Integer
ChildState
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.
- Integer
Dump
Clear_Breakpoints()
05/18/95 - When a report is started all breakpoints should be
cleared.
- Integer
cnt - Integer
i - Integer
Arr#
- Integer
Setup_Report()
Function_Setup Report
If a non-zero value is returned the report will not be run
- Integer
retval
- 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
- 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
RptChannel
- 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
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.
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.
- 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.
- Integer
RCount - Integer
Rpt_Status - Integer
CBreak
Handle_End_Report()
Procedure: Handle_End_Report
Shut down report in normal manner. Print final subtotals, totals
and footers
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.
OnBody()
Procedure: OnBody
Normally this is overridden. In nested reports this can be sued
by the parent to start all of the inner reports.
- Integer
Rpt_Status
- 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.
Filler()
print 1 filler line as needed
Restore_Parent_Rec()
Procedure: Restore_Parent_Rec
- RowId
riRec
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
RptChannel
Handle_SubTotals(Integer CBrk)
Procedure: Handle_SubTotals (Internal)
- Integer
Flag - Integer
i - Integer
R_S - Integer
MSG
Handle_SubHeaders(Integer CBrk)
Procedure: Handle_SubHeaders (Internal)
- Integer
NBrks - Integer
i - Integer
Msg
RePrint_SubHeaders()
Procedure: RePrint_SubHeaders (Internal)
RePrint SubHeaders as part of a page break
- Integer
i - Integer
Lvl - Integer
Msg
New_Page()
Procedure: New_Page (internal)
Handle_Footer(Integer LastTime)
Procedure: Hanle_Footer (Internal)
Do Filler and footer
- Integer
i - Integer
PE
Final_FormFeed()
Procedure Final_Formfeed
intended for augmentation/override
Called to eject the last page after the main report has
processed all records.
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
- Integer
Lnes - Integer
Cnt
- Integer
Page_End_Check(Integer Lines)
Function: Page_End_Check (internal)
- Integer
i - Integer
Stat
Page_Check(Integer Lines)
Procedure: Page_Check (internal)
check if room for new image..if not new page
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.
- Integer
Save122#
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)
- Integer
L
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.
Page_Footer_set()
Page_bottom_Set()
Page_total_Set()
Report_Footer_Set()
Mark_Main_Report_Id(Integer Obj#)
Mark this child report object's Main report Id along with all of
its children
Mark_Rpt_Children()
Mark_as_Rpt_Child()
Constrain()
intended for override/augmentation
OnConstrain()
added optional support for OnConstrain
Rebuild_Constraints()
- integer
which_index(integer file# integer field#)
returns index# (incl. 0) or 0 if unindexed/error
- Integer
fldNdx
End_Construct_Object()