TpAUX CLASE SUBTOTAL unit
Ir a la navegación
Ir a la búsqueda
Descripción
El objeto TpAUX_CLASE_SUBTOTAL_unit (Subtotales desde detalles en edición de clases) procesa los auxiliares de tipo SUBTOTAL, ver detalles en DEV AUXILIARES/SUBTOTAL.
Identidad
- Ancestro: TComponent
- Carpeta: C:\DevelopPrx\pPRAGMA
- Archivo: pAUX_CLASE_SUBTOTAL_unit.pas
Declaración
type
TpAUX_CLASE_SUBTOTAL_item = record
Dataset: TprxADODataSet;
Parser: Tfva_parser_fbn;
Campo: String;
Calculo: String;
Regla: String;
ModoSubtotal: String;
UsaMaster: Boolean;
Valor: Variant;
end;
type
TpAUX_CLASE_SUBTOTAL_unit = class(TComponent)
private
FQuery: TprxADOQuery;
FSQL_CALCULO: TStringList;
FSQL_REGLA: TStringList;
FTag_MODOSUBTOTAL: String;
FTag_USAMASTERDS: Boolean;
FItems: TStringList;
protected
Reglas: array[0..13] of TpAUX_CLASE_SUBTOTAL_item;
ReglasCount: Integer;
property SQL_CALCULO: TStringList read FSQL_CALCULO write FSQL_CALCULO;
property SQL_REGLA: TStringList read FSQL_REGLA write FSQL_REGLA;
property Tag_MODOSUBTOTAL: String read FTag_MODOSUBTOTAL write FTag_MODOSUBTOTAL;
property Tag_USAMASTERDS: Boolean read FTag_USAMASTERDS write FTag_USAMASTERDS;
function ExecuteDataset(aDataSet: TprxADODataSetEdit; aTableName: String): Boolean;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
function Execute(aMasterDS: TprxADODataSet): Boolean;
property Query: TprxADOQuery read FQuery write FQuery;
property Items: TStringList read FItems;
published
end;
Implementación
function ExecuteDataset(aDataSet: TprxADODataSetEdit; aTableName: String): Boolean
Este Execute lo llama cada clase detalle de la clase de la función Execute. Retorna True si define subtotales.
function Execute(aMasterDS: TprxADODataSet): Boolean
Similar anterior pero llamado por un master.
Modo de uso
El auxiliar se usa de la siguiente manera (ejemplo tomado de TprxADODataSetMaster.ChildHasPosted):
procedure TprxADODataSetMaster.ChildHasPosted(aChildDS: TprxADODataSetMaster); begin prxADOClientDM.pAUX_CLASE_SUBTOTAL_unit.Execute(Self); end;
Cuando el evento ChildHasPosted se ejecuta (cada vez que un detail postea un registro) directamente se llama a la función Execute del auxiliar para subtotalizar lo que corresponda.
Usos
Este auxiliar lo usa:
- TprxADODataSetMaster.ChildHasPosted).