Module Reportds.pkg
************************************************************************
Confidential Trade Secret.
Copyright 1987-1995 Data Access Corporation, Miami FL, USA
All Rights reserved
DataFlex is a registered trademark of Data Access Corporation.
************************************************************************
************************************************************************
ReportDS.Pkg
Version: 1.1
Wed 11-25-1992 Created
Author: John J. Tuohy
************************************************************************
2/26/2002 JJT - 8.2 clean up (indirect_file, local, self, etc.)
12/13/2001 JJT - Added Validate_items dummy method to report object
10/19/97 JJT - changed find_init to send clear to srvr when DD used.
Otherwise parent is not cleared and it is attached in for
a find first.
06/09/97 JJT - made mods for DD support. Request_Save in RO now sends
************************************************************************
Report_Ds - Report class that can optionally use data_sets.
If Data_sets are used the report can support batch updates where files
are saved and deleted (via request_save and request_delete).
IMPORTANT: All constraints including "relates to" constraints MUST be
handled by the data_set and not the report object (when in Rome do as the
Romans). Also, the report's relate_main_file, No_Constrained_Find_State and
No_relate_state are ignored - these same properties in the data_set are used
instead.
This class can be used as a non-data_set class (just don't set the server).
New Syntax:
To hook into a Data_set, three syntaxes
Object Order_Rpt is a Report_ds Using DATA_SET_NAME
<or> Object Order_Rpt is a Report_ds
Report_Data_Set DATA_SET_NAME
<or> Object Order_Rpt is a Report_ds
Set Server to DATA_SET_NAME
New Public Interface:
PROPERTY: Server
This is the object ID of the data_set. If 0, the report will behave
exactly like a non_ds report. This is usually only set once and
usually when the object is created. This can be done with the USING
object command line parameter, the SET SERVER TO command, or the
RPT_DATA_SET command.
PROPERTY: Deferred_State (Default=TRUE)
This determines if accesses to the data_set causes refresh messages
to get sent to other objects using this data_set. Setting this TRUE
reduces traffic a bit. This can be set FALSE but you should know what
you are doing.
PROCEDURE: Request_Save
If sent, will save the current record. Usually sent in Body section.
Use Entry_Update message to make the changes during the save process.
All parent files are properly modified. This is M/U solid.
PROCEDURE: Request_Delete
If sent (usually in the body) this will delete the current record thru
the data_set. After delete the record remains unchanged in the buffer
(including the recnum). All parent files are properly updated and
all multi-user requirements are met.
PROCEDURE Entry_Update
Does nothing. This is the user hook that you fill out to make changes
the record you are saving. If this were a DEO this would get called
when you need to update from the forms to the database. This is a
manual version of this.
PROCEDURE Refresh
This is normally a stub that does nothing. A clever data_set expert
might be able to make use of this.
Changes for RowId
Removed Read_by_recnum, Replaced with RowId
removed Found_rec to priFoundRec
Reportds.pkg (view source)- import declarations
- Report_DS : Report
- Construct_Object()
Integer Img#
- IntegerServer
**// I had toyed with supporting constraints in both data_sets and
**// the report object. I decided against this because data_sets get
**// too complicated when you deal with saves and deletes, and, I felt
**// it was best to work "within the system" and let Data_sets do what
**// they want.
**//
**// Constrain_by_Report_State: If true and using data_sets
**// nesting of reports determines the
**// relates_to constraint. Server constraints
**// are always respected
**Property Integer Constrain_by_Report_State FALSE // alter with care
data_set
- IntegerDeferred_State
When used with DDs, deferred_state will really not work properly and
should therefore be avoided.
makes less traffic
- IntegerAuto_Fill_State
Required not used
- Refresh()
Display - required
- Entry_Update()
Update from report to datafile.
- integerValidate_Items(integer iFg)
Could be sent by validate_items from DDO. -required
- Request_Delete()
Supports deletes. Should be called in body
- IntegerSrvr#
- IntegeriRec
- IntegeriFile
- IntegeriStat
- BooleanbSupportRecnum
- Request_Save()
supports saves
- IntegerSrvr#
- IntegerNotOK
- integerStart_Report()
Augmented to add this object from the Data_set's user interface
- IntegerRetval
- integerEnd_Report(integer rpt_Status)
Augmented to remove this object from the Data_set's user interface
See notes in Start_report about 11.1 change
- IntegerRetval
- AddReportsToServer()
See notes in Start_report. Added in 11.1 Attaches all reports to all DDs just once in outer report
- IntegerhoDD
- BooleanbHasChildren
- RemoveReportsFromServer()
See notes in Start_report. Added in 11.1 detaches all reports from all DDs just once in outer report
- IntegerhoDD
- BooleanbHasChildren
- Find_Init()
Procedure: Find_Init
set up this file for finding... This clears the needed buffers
- IntegerSrvr#
- IntegerMode
- Integerfile#
- Integerndx#
- IntegerFind_Rec()
Augment to find record in Data_set if Server exists
- Integersrvr#
- Integerrval
- IntegerFile#
- IntegerNdx#
- IntegerDfrd
- IntegeriRec
- ReadByRowId(RowId riRec)
Procedure : ReadByRowId
Augmented to direct read to server
- IntegerhoDD
- IntegeriFile
- IntegereStat
- RowIdriCrnt
- RowIdriDDO
- BooleanbSameRec
- End_Construct_Object()
Procedure ReadByRowId RowId riRec
Handle hoDD
integer iFile
Get Server to hoDD
If not hoDD begin
Forward send ReadByRowId riRec
end
Else Begin
Get Main_File of hoDD to iFile
If (Deferred_state(self)) begin
Send ReadbyRowId of hoDD iFile riRec // if deferred
end
Else Begin
Send FindByRowId of hoDD iFile riRec // if not deferred
end
End
End_procedure
Procedure Read_By_Recnum Integer Rec#
Integer srvr# File#
Get Server to Srvr#
If Srvr# eq 0 Forward send Read_by_Recnum Rec#
Else Begin
Get Main_File of Srvr# to File#
If (Deferred_state(self)) ;
Send Read_by_Recnum to srvr# File# rec# // if deferred
Else Send Find_by_Recnum to srvr# File# rec# // if not deferred
End
End_procedure
Augment to set Report Object's main_file if server exists
- IntegerSrvr#
- IntegerFile#
- Report_DS_Start
- bind_report_Data_set
- Report_Data_Set
Set a report's dataset
References (1):
Field References (0):
Module | Containing Symbol | Line |
---|