Module cReportDS.pkg
****************************************************************************//
//
$File name : cReportDS.PKG //
$File title : cReportDS class //
$Author : John Tuohy //
//
Confidential Trade Secret. //
Copyright 1991-1999 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
************************************************************************
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 OnBody 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.
cReportDS.pkg (view source)- import declarations
- cReportDS : cReport
Construct_Object()
Integer Img#
Refresh()
Display - required
Entry_Update()
Update from report to datafile.
- integer
Validate_items(integer fg)
called during request_validate to DDO
Request_Delete()
Supports deletes. Should be called in body
- Integer
Srvr# - Integer
iRec - Integer
iFile - Integer
iStat - Boolean
bSupportRecnum
Request_Save()
supports saves
- Integer
Srvr# - Integer
NotOK
AddReportsToServer()
See notes in DoRunReport. Added in 11.1 Attaches all reports to all DDs just once in outer report
- Integer
hoDD - Boolean
bHasChildren
RemoveReportsFromServer()
See notes in DoRunReport. Added in 11.1 detaches all reports from all DDs just once in outer report
- Integer
hoDD - Boolean
bHasChildren
- integer
DoRunReport()
Augmented to add this object from the Data_set's user interface
- Integer
Retval
- integer
End_Report(integer rpt_Status)
Augmented to remove this object from the Data_set's user interface
See notes in DoRunReport about 11.1 change
- Integer
Retval
Find_Init()
Procedure: Find_Init
set up this file for finding... This clears the needed buffers
- Integer
Srvr# - Integer
Mode - Integer
file# - Integer
ndx#
- Integer
Find_Rec()
Augment to find record in Data_set if Server exists
- Integer
srvr# - Integer
rval - Integer
File# - Integer
Ndx# - Integer
Dfrd - Integer
iRec
ReadByRowId(RowId riRec)
- Integer
hoDD - Integer
iFile - Integer
eStat - RowId
riCrnt - RowId
riDDO - Boolean
bSameRec
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
// Augmented to direct read to server
//
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
**Procedure rebuild_constraints
** Integer srvr#
** Get server to srvr#
** if srvr# eq 0 forward send rebuild_constraints
** Else Begin
** send rebuild_constraints to srvr#
** if (Constrain_by_Report_State(self)) Send constrain
** End
**End_procedure
**
**Procedure constrain
** integer srvr# file# Prnt_srvr#
** Get server to srvr#
** If Srvr# eq 0 Forward send constrain // this'll set object relates to constraint
** else begin
** if (pbChildReport(self)) begin
** delegate get Server to Prnt_srvr#
** CONSTRAIN (Main_File(srvr#)) RELATES TO ;
** (if(prnt_srvr#=0,;
** Main_File(Parent(self)), Main_file(Prnt_Srvr#)))
** end
** end
**End_Procedure
Augment to set Report Object's main_file if server exists
- Integer
Srvr# - Integer
File#
- Report_Data_Set
Set a report's dataset
References (1):
Field References (0):
Module | Containing Symbol | Line |
---|