From 0dc06b37b1b39ce888c1035e140644d52f66a590 Mon Sep 17 00:00:00 2001 From: roberto Date: Tue, 4 Sep 2007 17:31:56 +0000 Subject: [PATCH] git-svn-id: https://192.168.0.254/svn/Proyectos.Tecsitel_FactuGES2/trunk@4 0c75b7a4-871f-7646-8a2f-f78d34cc349f --- .../Reports/uRptEtiquetasContacto_Server.dfm | 591 ++++++++++ .../Reports/uRptEtiquetasContacto_Server.pas | 92 ++ .../Reports/uRptFichasEmpleado_Server.dfm | 1035 +++++++++++++++++ .../Reports/uRptFichasEmpleado_Server.pas | 108 ++ 4 files changed, 1826 insertions(+) create mode 100644 Source/Modulos/Contactos/Reports/uRptEtiquetasContacto_Server.dfm create mode 100644 Source/Modulos/Contactos/Reports/uRptEtiquetasContacto_Server.pas create mode 100644 Source/Modulos/Contactos/Reports/uRptFichasEmpleado_Server.dfm create mode 100644 Source/Modulos/Contactos/Reports/uRptFichasEmpleado_Server.pas diff --git a/Source/Modulos/Contactos/Reports/uRptEtiquetasContacto_Server.dfm b/Source/Modulos/Contactos/Reports/uRptEtiquetasContacto_Server.dfm new file mode 100644 index 00000000..447b847d --- /dev/null +++ b/Source/Modulos/Contactos/Reports/uRptEtiquetasContacto_Server.dfm @@ -0,0 +1,591 @@ +object RptEtiquetasContacto: TRptEtiquetasContacto + OldCreateOrder = True + OnCreate = DataModuleCreate + Height = 405 + Width = 447 + object DADataCabecera: TDADataSource + DataTable = tbl_Contactos + Left = 264 + Top = 72 + end + object tbl_Contactos: TDACDSDataTable + RemoteUpdatesOptions = [] + Fields = <> + Params = <> + MasterMappingMode = mmDataRequest + LogChanges = False + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteFetchEnabled = False + SchemaCall.Params = <> + DataRequestCall.Params = <> + DataUpdateCall.Params = <> + ScriptCall.Params = <> + ReadOnly = False + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + IndexDefs = <> + Left = 264 + Top = 128 + end + object DABINAdapter: TDABINAdapter + Left = 48 + Top = 80 + end + object frxRichObject1: TfrxRichObject + Left = 48 + Top = 296 + end + object frxBarCodeObject1: TfrxBarCodeObject + Left = 144 + Top = 296 + end + object frxOLEObject1: TfrxOLEObject + Left = 48 + Top = 344 + end + object frxCrossObject1: TfrxCrossObject + Left = 144 + Top = 344 + end + object frxCheckBoxObject1: TfrxCheckBoxObject + Left = 256 + Top = 296 + end + object frxGradientObject1: TfrxGradientObject + Left = 360 + Top = 296 + end + object frxChartObject1: TfrxChartObject + Left = 256 + Top = 344 + end + object schReport: TDASchema + ConnectionManager = dmServer.ConnectionManager + DataDictionary = DataDictionary + Datasets = < + item + Params = <> + Statements = < + item + Connection = 'IBX' + TargetTable = 'V_CONTACTOS' + SQL = + 'select'#10' ID,'#10' NIF_CIF,'#10' NOMBRE,'#10' PERSONA_CONTACTO,'#10' ' + + ' CALLE,'#10' POBLACION,'#10' PROVINCIA,'#10' CODIGO_POSTAL'#10'from CO' + + 'NTACTOS' + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'ID' + TableField = 'ID' + end + item + DatasetField = 'NIF_CIF' + TableField = 'NIF_CIF' + end + item + DatasetField = 'NOMBRE' + TableField = 'NOMBRE' + end + item + DatasetField = 'PERSONA_CONTACTO' + TableField = 'PERSONA_CONTACTO' + end + item + DatasetField = 'CALLE' + TableField = 'CALLE' + end + item + DatasetField = 'POBLACION' + TableField = 'POBLACION' + end + item + DatasetField = 'PROVINCIA' + TableField = 'PROVINCIA' + end + item + DatasetField = 'CODIGO_POSTAL' + TableField = 'CODIGO_POSTAL' + end> + end> + Name = 'InformeEtiquetasContacto' + Fields = < + item + Name = 'ID' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'NIF_CIF' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'NOMBRE' + DataType = datString + Size = 255 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'PERSONA_CONTACTO' + DataType = datString + Size = 255 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CALLE' + DataType = datString + Size = 255 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'POBLACION' + DataType = datString + Size = 255 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'PROVINCIA' + DataType = datString + Size = 255 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CODIGO_POSTAL' + DataType = datString + Size = 10 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end> + BusinessRulesClient.ScriptLanguage = rslPascalScript + BusinessRulesServer.ScriptLanguage = rslPascalScript + end> + Commands = <> + RelationShips = <> + UpdateRules = <> + Left = 48 + Top = 16 + end + object DataDictionary: TDADataDictionary + Fields = < + item + Name = 'FacturasCliente_ID' + DataType = datAutoInc + BlobType = dabtUnknown + Required = True + DisplayWidth = 0 + DisplayLabel = 'ID' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_ID_EMPRESA' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'ID_EMPRESA' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_ID_CONTRATO' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'ID_CONTRATO' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_FECHA_FACTURA' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Fecha de las factura' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_VENCIMIENTO' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Vencimiento' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_SITUACION' + DataType = datString + Size = 255 + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Situaci'#243'n' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_BASE_IMPONIBLE' + DataType = datFloat + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Base imponible' + Alignment = taRightJustify + end + item + Name = 'FacturasCliente_IMPORTE_DESCUENTO' + DataType = datFloat + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Importe dto.' + Alignment = taRightJustify + end + item + Name = 'FacturasCliente_IMPORTE_IVA' + DataType = datFloat + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Importe IVA' + Alignment = taRightJustify + end + item + Name = 'FacturasCliente_IMPORTE_TOTAL' + DataType = datFloat + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Importe total' + Alignment = taRightJustify + end + item + Name = 'FacturasCliente_FORMA_PAGO' + DataType = datMemo + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Forma de pago' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_ID_CLIENTE' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'ID_CLIENTE' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_NIF_CIF' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'NIF/CIF' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_CODIGO_POSTAL' + DataType = datString + Size = 10 + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'C'#243'd. postal' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_FECHA_ALTA' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'FECHA_ALTA' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_FECHA_MODIFICACION' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'FECHA_MODIFICACION' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_OBSERVACIONES' + DataType = datMemo + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Observaciones' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_NOMBRE' + DataType = datString + Size = 100 + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Cliente' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_CALLE' + DataType = datString + Size = 150 + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Direcci'#243'n' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_PROVINCIA' + DataType = datString + Size = 30 + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Provincia' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_POBLACION' + DataType = datString + Size = 150 + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Poblaci'#243'n' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_IVA' + DataType = datFloat + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'IVA' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_USUARIO' + DataType = datString + Size = 100 + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'USUARIO' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_REFERENCIA' + DataType = datString + Size = 20 + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Referencia' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_DESCUENTO' + DataType = datFloat + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Dto.' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_Detalles_ID' + DataType = datAutoInc + BlobType = dabtUnknown + Required = True + DisplayWidth = 0 + DisplayLabel = 'ID' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_Detalles_ID_FACTURA' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'ID_FACTURA' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_Detalles_TIPO_DETALLE' + DataType = datString + Size = 10 + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Tipo detalle' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_Detalles_CONCEPTO' + DataType = datString + Size = 2000 + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Concepto' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_Detalles_IMPORTE_UNIDAD' + DataType = datFloat + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Importe unidad' + Alignment = taRightJustify + end + item + Name = 'FacturasCliente_Detalles_IMPORTE_TOTAL' + DataType = datFloat + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Importe total' + Alignment = taRightJustify + end + item + Name = 'FacturasCliente_Detalles_VISIBLE' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = #191'Visible?' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_Detalles_POSICION' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Posici'#243'n' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_Detalles_CANTIDAD' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Cantidad' + Alignment = taLeftJustify + end> + Left = 46 + Top = 158 + end + object frxReport: TfrxReport + Version = '3.23.7' + DotMatrixReport = False + IniFile = '\Software\Fast Reports' + PreviewOptions.Buttons = [pbPrint, pbLoad, pbSave, pbExport, pbZoom, pbFind, pbOutline, pbPageSetup, pbTools, pbEdit, pbNavigator, pbExportQuick] + PreviewOptions.Zoom = 1.000000000000000000 + PrintOptions.Printer = 'Por defecto' + ReportOptions.CreateDate = 38330.712904247710000000 + ReportOptions.LastChange = 39328.775946539350000000 + ScriptLanguage = 'PascalScript' + ScriptText.Strings = ( + 'procedure Memo2OnBeforePrint(Sender: TfrxComponent);' + 'var' + ' Cadena: String;' + 'begin' + ' Cadena := '#39#39';' + '' + ' if ( <> '#39#39') then' + ' Cadena := UPPERCASE();' + '' + ' Memo2.Lines.Clear;' + ' Memo2.Lines.Add(Cadena);' + '' + ' if ( <> '#39#39') then' + ' Cadena := UPPERCASE();' + ' Memo2.Lines.Add(Cadena);' + '' + ' Cadena := '#39#39';' + ' if ( <> '#39#39') then' + ' Cadena := UPPERCASE();' + '' + ' if ( <> '#39#39') then' + ' if (Cadena <> '#39#39') then' + + ' Cadena := Cadena + '#39' '#39' + UPPERCASE();' + '' + ' if ( <> '#39#39')' + + ' and ( <> ) then' + ' begin' + ' if ( <> '#39#39') then' + + ' Cadena := Cadena + '#39' ('#39' + UPPERCASE() + '#39')'#39 + ' else' + + ' Cadena := Cadena + '#39' '#39' + UPPERCASE();' + ' end;' + ' Memo2.Lines.Add(Cadena);' + '' + ' Cadena := '#39#39';' + ' Memo2.Lines.Add(Cadena);' + ' if ( <> '#39#39') then' + + ' Cadena := '#39'ATT. '#39' + UPPERCASE();' + ' Memo2.Lines.Add(Cadena);' + 'end;' + '' + 'begin' + '' + 'end.') + ShowProgress = False + StoreInDFM = False + Left = 169 + Top = 16 + Datasets = < + item + DataSet = frxDBCabecera + DataSetName = 'frxDBCabecera' + end> + Variables = <> + Style = <> + end + object frxDBCabecera: TfrxDBDataset + UserName = 'frxDBCabecera' + CloseDataSource = True + DataSource = DADataCabecera + Left = 264 + Top = 16 + end +end diff --git a/Source/Modulos/Contactos/Reports/uRptEtiquetasContacto_Server.pas b/Source/Modulos/Contactos/Reports/uRptEtiquetasContacto_Server.pas new file mode 100644 index 00000000..c2c4af9b --- /dev/null +++ b/Source/Modulos/Contactos/Reports/uRptEtiquetasContacto_Server.pas @@ -0,0 +1,92 @@ +unit uRptEtiquetasContacto_Server; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, frxClass, frxDBSet, uDAScriptingProvider, + uDADataTable, uDACDSDataTable, DB, uDAClasses, frxChart, frxGradient, + frxChBox, frxCross, frxOLE, frxBarcode, frxRich, uDABINAdapter, uROTypes, + uDAInterfaces; + +type + TRptEtiquetasContacto = class(TDataModule) + DADataCabecera: TDADataSource; + tbl_Contactos: TDACDSDataTable; + DABINAdapter: TDABINAdapter; + frxRichObject1: TfrxRichObject; + frxBarCodeObject1: TfrxBarCodeObject; + frxOLEObject1: TfrxOLEObject; + frxCrossObject1: TfrxCrossObject; + frxCheckBoxObject1: TfrxCheckBoxObject; + frxGradientObject1: TfrxGradientObject; + frxChartObject1: TfrxChartObject; + frxDBCabecera: TfrxDBDataset; + frxReport: TfrxReport; + schReport: TDASchema; + DataDictionary: TDADataDictionary; + procedure DataModuleCreate(Sender: TObject); + private + FConnection: IDAConnection; + public + function GenerarInforme(const AID : String): Binary; overload; + end; + +implementation + +{$R *.dfm} + +uses + uDataModuleServer, schContactosClient_Intf; + +const + rptEtiquetasContacto = 'InfEtiquetasContacto.fr3'; + + { Dataset names for schReport } + ds_InformeContactos = 'InformeEtiquetasContacto'; + + +{ TRptEtiquetasContacto } + + +procedure TRptEtiquetasContacto.DataModuleCreate(Sender: TObject); +begin + schReport.ConnectionManager := dmServer.ConnectionManager; + FConnection := dmServer.DarNuevaConexion; + frxReport.EngineOptions.NewSilentMode := simReThrow; +end; + +function TRptEtiquetasContacto.GenerarInforme(const AID: String): Binary; +var + AStream: TMemoryStream; + dsMaster: IDADataset; + +begin + Result := Binary.Create; + + FConnection.BeginTransaction; + + try + AStream := TMemoryStream.Create; + dsMaster := schReport.NewDataset(FConnection, ds_InformeContactos, [], [], False); //, ['ID'], ['611, 751']); //AID]); + dsMaster.Where.AddText(fld_ContactosID + ' in (' + AID + ')'); + dsMaster.Open; + + AStream.Clear; + DABINAdapter.WriteDataset(AStream, dsMaster, [woRows, woSchema], -1); + DABINAdapter.ReadDataset(AStream, tbl_Contactos, TRUE, '', TRUE, TRUE); + + frxReport.LoadFromFile(DarRutaInformes + rptEtiquetasContacto, True); + frxReport.PrepareReport(True); + + frxReport.PreviewPages.SaveToStream(Result); + + finally + AStream.Free; + dsMaster := Nil; + FConnection.RollbackTransaction; + end; + +end; + +end. diff --git a/Source/Modulos/Contactos/Reports/uRptFichasEmpleado_Server.dfm b/Source/Modulos/Contactos/Reports/uRptFichasEmpleado_Server.dfm new file mode 100644 index 00000000..03e9c9aa --- /dev/null +++ b/Source/Modulos/Contactos/Reports/uRptFichasEmpleado_Server.dfm @@ -0,0 +1,1035 @@ +object RptFichasEmpleado: TRptFichasEmpleado + OldCreateOrder = True + OnCreate = DataModuleCreate + Height = 405 + Width = 447 + object DADataCabecera: TDADataSource + DataTable = tbl_FichaEmpleado + Left = 264 + Top = 72 + end + object tbl_FichaEmpleado: TDACDSDataTable + RemoteUpdatesOptions = [] + Fields = <> + Params = <> + MasterMappingMode = mmDataRequest + LogChanges = False + StreamingOptions = [soDisableEventsWhileStreaming] + RemoteFetchEnabled = False + SchemaCall.Params = <> + DataRequestCall.Params = <> + DataUpdateCall.Params = <> + ScriptCall.Params = <> + ReadOnly = False + DetailOptions = [dtCascadeOpenClose, dtCascadeApplyUpdates, dtAutoFetch, dtCascadeDelete, dtCascadeUpdate, dtDisableLogOfCascadeDeletes, dtDisableLogOfCascadeUpdates, dtIncludeInAllInOneFetch] + MasterOptions = [moCascadeOpenClose, moCascadeApplyUpdates, moCascadeDelete, moCascadeUpdate, moDisableLogOfCascadeDeletes, moDisableLogOfCascadeUpdates] + IndexDefs = <> + Left = 264 + Top = 128 + end + object DABINAdapter: TDABINAdapter + Left = 48 + Top = 80 + end + object frxRichObject1: TfrxRichObject + Left = 48 + Top = 296 + end + object frxBarCodeObject1: TfrxBarCodeObject + Left = 144 + Top = 296 + end + object frxOLEObject1: TfrxOLEObject + Left = 48 + Top = 344 + end + object frxCrossObject1: TfrxCrossObject + Left = 144 + Top = 344 + end + object frxCheckBoxObject1: TfrxCheckBoxObject + Left = 256 + Top = 296 + end + object frxGradientObject1: TfrxGradientObject + Left = 360 + Top = 296 + end + object frxChartObject1: TfrxChartObject + Left = 256 + Top = 344 + end + object schReport: TDASchema + ConnectionManager = dmServer.ConnectionManager + DataDictionary = DataDictionary + Datasets = < + item + Params = < + item + Name = 'ID' + DataType = datInteger + BlobType = dabtUnknown + Value = '' + ParamType = daptInput + end> + Statements = < + item + Connection = 'IBX' + TargetTable = 'V_EMPLEADOS' + SQL = + 'select'#10' V_EMPLEADOS.ID,'#10' V_EMPLEADOS.ID_CATEGORIA,'#10' V_E' + + 'MPLEADOS.NIF_CIF,'#10' V_EMPLEADOS.NOMBRE,'#10' V_EMPLEADOS.PERSON' + + 'A_CONTACTO,'#10' V_EMPLEADOS.CALLE,'#10' V_EMPLEADOS.POBLACION,'#10' ' + + ' V_EMPLEADOS.PROVINCIA,'#10' V_EMPLEADOS.CODIGO_POSTAL,'#10' V_EM' + + 'PLEADOS.TELEFONO_1,'#10' V_EMPLEADOS.TELEFONO_2,'#10' V_EMPLEADOS.' + + 'MOVIL_1,'#10' V_EMPLEADOS.MOVIL_2,'#10' V_EMPLEADOS.FAX,'#10' V_EMP' + + 'LEADOS.EMAIL_1,'#10' V_EMPLEADOS.EMAIL_2,'#10' V_EMPLEADOS.PAGINA_' + + 'WEB,'#10' V_EMPLEADOS.NOTAS,'#10' V_EMPLEADOS.FECHA_ALTA,'#10' V_EM' + + 'PLEADOS.FECHA_MODIFICACION,'#10' V_EMPLEADOS.USUARIO,'#10' V_EMPLE' + + 'ADOS.ID_EMPRESA,'#10' V_EMPLEADOS.REFERENCIA,'#10' V_EMPLEADOS.FEC' + + 'HA_NACIMIENTO,'#10' V_EMPLEADOS.CATEGORIA,'#10' V_EMPLEADOS.FECHA_' + + 'ALTA_EMPRESA,'#10' V_EMPLEADOS.FORMACION_BASE,'#10' V_EMPLEADOS.FO' + + 'RMACION_COMPLE,'#10' V_EMPLEADOS.FORMACION_RECIBIDA,'#10' V_EMPLEA' + + 'DOS.EXPERIENCIA,'#10' EMPRESAS.NOMBRE as NOMBRE_EMPRESA,'#10' EMPR' + + 'ESAS.RAZON_SOCIAL,'#10' EMPRESAS.TELEFONO_1 as TELEFONO_1_EMPRESA' + + ','#10' EMPRESAS.FAX as FAX_EMPRESA,'#10' EMPRESAS.LOGOTIPO'#10' '#10'fr' + + 'om V_EMPLEADOS'#10'left join EMPRESAS on (EMPRESAS.ID = V_EMPLEADOS.' + + 'ID_EMPRESA)'#10'where V_EMPLEADOS.ID = :ID' + StatementType = stSQL + ColumnMappings = < + item + DatasetField = 'ID' + TableField = 'ID' + end + item + DatasetField = 'ID_CATEGORIA' + TableField = 'ID_CATEGORIA' + end + item + DatasetField = 'NIF_CIF' + TableField = 'NIF_CIF' + end + item + DatasetField = 'NOMBRE' + TableField = 'NOMBRE' + end + item + DatasetField = 'PERSONA_CONTACTO' + TableField = 'PERSONA_CONTACTO' + end + item + DatasetField = 'CALLE' + TableField = 'CALLE' + end + item + DatasetField = 'POBLACION' + TableField = 'POBLACION' + end + item + DatasetField = 'PROVINCIA' + TableField = 'PROVINCIA' + end + item + DatasetField = 'CODIGO_POSTAL' + TableField = 'CODIGO_POSTAL' + end + item + DatasetField = 'TELEFONO_1' + TableField = 'TELEFONO_1' + end + item + DatasetField = 'TELEFONO_2' + TableField = 'TELEFONO_2' + end + item + DatasetField = 'MOVIL_1' + TableField = 'MOVIL_1' + end + item + DatasetField = 'MOVIL_2' + TableField = 'MOVIL_2' + end + item + DatasetField = 'FAX' + TableField = 'FAX' + end + item + DatasetField = 'EMAIL_1' + TableField = 'EMAIL_1' + end + item + DatasetField = 'EMAIL_2' + TableField = 'EMAIL_2' + end + item + DatasetField = 'PAGINA_WEB' + TableField = 'PAGINA_WEB' + end + item + DatasetField = 'NOTAS' + TableField = 'NOTAS' + end + item + DatasetField = 'FECHA_ALTA' + TableField = 'FECHA_ALTA' + end + item + DatasetField = 'FECHA_MODIFICACION' + TableField = 'FECHA_MODIFICACION' + end + item + DatasetField = 'USUARIO' + TableField = 'USUARIO' + end + item + DatasetField = 'ID_EMPRESA' + TableField = 'ID_EMPRESA' + end + item + DatasetField = 'REFERENCIA' + TableField = 'REFERENCIA' + end + item + DatasetField = 'FECHA_NACIMIENTO' + TableField = 'FECHA_NACIMIENTO' + end + item + DatasetField = 'CATEGORIA' + TableField = 'CATEGORIA' + end + item + DatasetField = 'FECHA_ALTA_EMPRESA' + TableField = 'FECHA_ALTA_EMPRESA' + end + item + DatasetField = 'FORMACION_BASE' + TableField = 'FORMACION_BASE' + end + item + DatasetField = 'FORMACION_COMPLE' + TableField = 'FORMACION_COMPLE' + end + item + DatasetField = 'FORMACION_RECIBIDA' + TableField = 'FORMACION_RECIBIDA' + end + item + DatasetField = 'EXPERIENCIA' + TableField = 'EXPERIENCIA' + end + item + DatasetField = 'NOMBRE_EMPRESA' + TableField = 'NOMBRE_EMPRESA' + end + item + DatasetField = 'RAZON_SOCIAL' + TableField = 'RAZON_SOCIAL' + end + item + DatasetField = 'FAX_EMPRESA' + TableField = 'FAX_EMPRESA' + end + item + DatasetField = 'TELEFONO_1_EMPRESA' + TableField = 'TELEFONO_1_EMPRESA' + end + item + DatasetField = 'LOGOTIPO' + TableField = 'LOGOTIPO' + end> + end> + Name = 'InformeFichasEmpleado' + Fields = < + item + Name = 'ID' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ID_CATEGORIA' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'NIF_CIF' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'NOMBRE' + DataType = datString + Size = 255 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'PERSONA_CONTACTO' + DataType = datString + Size = 255 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CALLE' + DataType = datString + Size = 255 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'POBLACION' + DataType = datString + Size = 255 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'PROVINCIA' + DataType = datString + Size = 255 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CODIGO_POSTAL' + DataType = datString + Size = 10 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'TELEFONO_1' + DataType = datString + Size = 25 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'TELEFONO_2' + DataType = datString + Size = 25 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'MOVIL_1' + DataType = datString + Size = 25 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'MOVIL_2' + DataType = datString + Size = 25 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'FAX' + DataType = datString + Size = 25 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'EMAIL_1' + DataType = datString + Size = 255 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'EMAIL_2' + DataType = datString + Size = 255 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'PAGINA_WEB' + DataType = datString + Size = 255 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'NOTAS' + DataType = datMemo + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'FECHA_ALTA' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'FECHA_MODIFICACION' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'USUARIO' + DataType = datString + Size = 20 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'ID_EMPRESA' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'REFERENCIA' + DataType = datString + Size = 255 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'FECHA_NACIMIENTO' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'CATEGORIA' + DataType = datString + Size = 255 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'FECHA_ALTA_EMPRESA' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'FORMACION_BASE' + DataType = datMemo + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'FORMACION_COMPLE' + DataType = datMemo + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'FORMACION_RECIBIDA' + DataType = datMemo + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'EXPERIENCIA' + DataType = datMemo + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'NOMBRE_EMPRESA' + DataType = datString + Size = 255 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'RAZON_SOCIAL' + DataType = datString + Size = 255 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'TELEFONO_1_EMPRESA' + DataType = datString + Size = 25 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'FAX_EMPRESA' + DataType = datString + Size = 25 + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end + item + Name = 'LOGOTIPO' + DataType = datBlob + BlobType = dabtUnknown + DisplayWidth = 0 + Alignment = taLeftJustify + InPrimaryKey = False + Calculated = False + Lookup = False + LookupCache = False + end> + BusinessRulesClient.ScriptLanguage = rslPascalScript + BusinessRulesServer.ScriptLanguage = rslPascalScript + end> + Commands = <> + RelationShips = <> + UpdateRules = <> + Left = 48 + Top = 16 + end + object DataDictionary: TDADataDictionary + Fields = < + item + Name = 'FacturasCliente_ID' + DataType = datAutoInc + BlobType = dabtUnknown + Required = True + DisplayWidth = 0 + DisplayLabel = 'ID' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_ID_EMPRESA' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'ID_EMPRESA' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_ID_CONTRATO' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'ID_CONTRATO' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_FECHA_FACTURA' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Fecha de las factura' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_VENCIMIENTO' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Vencimiento' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_SITUACION' + DataType = datString + Size = 255 + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Situaci'#243'n' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_BASE_IMPONIBLE' + DataType = datFloat + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Base imponible' + Alignment = taRightJustify + end + item + Name = 'FacturasCliente_IMPORTE_DESCUENTO' + DataType = datFloat + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Importe dto.' + Alignment = taRightJustify + end + item + Name = 'FacturasCliente_IMPORTE_IVA' + DataType = datFloat + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Importe IVA' + Alignment = taRightJustify + end + item + Name = 'FacturasCliente_IMPORTE_TOTAL' + DataType = datFloat + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Importe total' + Alignment = taRightJustify + end + item + Name = 'FacturasCliente_FORMA_PAGO' + DataType = datMemo + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Forma de pago' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_ID_CLIENTE' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'ID_CLIENTE' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_NIF_CIF' + DataType = datString + Size = 15 + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'NIF/CIF' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_CODIGO_POSTAL' + DataType = datString + Size = 10 + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'C'#243'd. postal' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_FECHA_ALTA' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'FECHA_ALTA' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_FECHA_MODIFICACION' + DataType = datDateTime + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'FECHA_MODIFICACION' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_OBSERVACIONES' + DataType = datMemo + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Observaciones' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_NOMBRE' + DataType = datString + Size = 100 + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Cliente' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_CALLE' + DataType = datString + Size = 150 + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Direcci'#243'n' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_PROVINCIA' + DataType = datString + Size = 30 + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Provincia' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_POBLACION' + DataType = datString + Size = 150 + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Poblaci'#243'n' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_IVA' + DataType = datFloat + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'IVA' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_USUARIO' + DataType = datString + Size = 100 + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'USUARIO' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_REFERENCIA' + DataType = datString + Size = 20 + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Referencia' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_DESCUENTO' + DataType = datFloat + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Dto.' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_Detalles_ID' + DataType = datAutoInc + BlobType = dabtUnknown + Required = True + DisplayWidth = 0 + DisplayLabel = 'ID' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_Detalles_ID_FACTURA' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'ID_FACTURA' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_Detalles_TIPO_DETALLE' + DataType = datString + Size = 10 + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Tipo detalle' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_Detalles_CONCEPTO' + DataType = datString + Size = 2000 + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Concepto' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_Detalles_IMPORTE_UNIDAD' + DataType = datFloat + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Importe unidad' + Alignment = taRightJustify + end + item + Name = 'FacturasCliente_Detalles_IMPORTE_TOTAL' + DataType = datFloat + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Importe total' + Alignment = taRightJustify + end + item + Name = 'FacturasCliente_Detalles_VISIBLE' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = #191'Visible?' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_Detalles_POSICION' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Posici'#243'n' + Alignment = taLeftJustify + end + item + Name = 'FacturasCliente_Detalles_CANTIDAD' + DataType = datInteger + BlobType = dabtUnknown + DisplayWidth = 0 + DisplayLabel = 'Cantidad' + Alignment = taLeftJustify + end> + Left = 46 + Top = 158 + end + object frxReport: TfrxReport + Version = '3.23.7' + DotMatrixReport = False + EngineOptions.DoublePass = True + IniFile = '\Software\Fast Reports' + PreviewOptions.Buttons = [pbPrint, pbLoad, pbSave, pbExport, pbZoom, pbFind, pbOutline, pbPageSetup, pbTools, pbEdit, pbNavigator, pbExportQuick] + PreviewOptions.Zoom = 1.000000000000000000 + PrintOptions.Printer = 'Por defecto' + ReportOptions.CreateDate = 39065.872423495400000000 + ReportOptions.LastChange = 39329.742127094910000000 + ScriptLanguage = 'PascalScript' + ScriptText.Strings = ( + 'var' + ' Pagina: Variant;' + '' + '' + 'procedure DatosEmpresaOnBeforePrint(Sender: TfrxComponent);' + 'var' + ' Cadena: String;' + 'begin' + ' DatosEmpresa.Lines.Clear;' + ' if ( <> '#39#39') then' + ' Cadena := '#39'TLF: '#39' + ;' + ' if ( <> '#39#39') then' + + ' Cadena := Cadena + '#39' FAX: '#39' + ;' + ' DatosEmpresa.Lines.Add(Cadena);' + 'end;' + '' + 'procedure NombreEmpresaOnBeforePrint(Sender: TfrxComponent);' + 'begin' + ' NombreEmpresa.Lines.Clear;' + ' NombreEmpresa.Lines.Add();' + 'end;' + '' + 'procedure PageHeader1OnBeforePrint(Sender: TfrxComponent);' + 'begin' + ' if not Engine.FinalPass then' + ' Set('#39'TotalPaginas'#39', ( + 1));' + '' + ' if Engine.FinalPass then' + ' Set('#39'Pagina'#39', ( + 1));' + 'end;' + '' + 'procedure frxReportOnStartReport(Sender: TfrxComponent);' + 'begin' + ' Set('#39'Pagina'#39', 0);' + ' Set('#39'TotalPaginas'#39', 0);' + 'end;' + '' + 'begin' + '' + 'end.') + ShowProgress = False + StoreInDFM = False + OnStartReport = 'frxReportOnStartReport' + Left = 169 + Top = 16 + Datasets = < + item + DataSet = frxDBCabecera + DataSetName = 'frxDBCabecera' + end> + Variables = < + item + Name = ' Paginacion' + Value = Null + end + item + Name = 'Pagina' + Value = Null + end + item + Name = 'TotalPaginas' + Value = Null + end> + Style = <> + end + object frxDBCabecera: TfrxDBDataset + UserName = 'frxDBCabecera' + CloseDataSource = True + DataSource = DADataCabecera + Left = 264 + Top = 16 + end +end diff --git a/Source/Modulos/Contactos/Reports/uRptFichasEmpleado_Server.pas b/Source/Modulos/Contactos/Reports/uRptFichasEmpleado_Server.pas new file mode 100644 index 00000000..7ed8ea02 --- /dev/null +++ b/Source/Modulos/Contactos/Reports/uRptFichasEmpleado_Server.pas @@ -0,0 +1,108 @@ +unit uRptFichasEmpleado_Server; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, frxClass, frxDBSet, uDAScriptingProvider, + uDADataTable, uDACDSDataTable, DB, uDAClasses, frxChart, frxGradient, + frxChBox, frxCross, frxOLE, frxBarcode, frxRich, uDABINAdapter, uROTypes, + uDAInterfaces; + +type + TRptFichasEmpleado = class(TDataModule) + DADataCabecera: TDADataSource; + tbl_FichaEmpleado: TDACDSDataTable; + DABINAdapter: TDABINAdapter; + frxRichObject1: TfrxRichObject; + frxBarCodeObject1: TfrxBarCodeObject; + frxOLEObject1: TfrxOLEObject; + frxCrossObject1: TfrxCrossObject; + frxCheckBoxObject1: TfrxCheckBoxObject; + frxGradientObject1: TfrxGradientObject; + frxChartObject1: TfrxChartObject; + frxDBCabecera: TfrxDBDataset; + frxReport: TfrxReport; + schReport: TDASchema; + DataDictionary: TDADataDictionary; + procedure DataModuleCreate(Sender: TObject); + private + FConnection: IDAConnection; + //Genera cada uno de los albaranes a imprimir + procedure GenerarFicha(const ID: integer); overload; + public + function GenerarFicha(const AFichaID : String): Binary; overload; + end; + +implementation + +{$R *.dfm} + +uses + uDataModuleServer, schContactosClient_Intf; + +const + rptFichaEmpleado = 'InfFichaEmpleado.fr3'; + + { Dataset names for schReport } + ds_InformeFichaEmpleado = 'InformeFichasEmpleado'; + + +{ TRptFichaEmpleado } + + +procedure TRptFichasEmpleado.DataModuleCreate(Sender: TObject); +begin + schReport.ConnectionManager := dmServer.ConnectionManager; + FConnection := dmServer.DarNuevaConexion; + frxReport.EngineOptions.NewSilentMode := simReThrow; +end; + +function TRptFichasEmpleado.GenerarFicha(const AFichaID: String): Binary; +var + ID_Fichas: TStringList; + i: Integer; + +begin + Result := Binary.Create; + FConnection.BeginTransaction; + + try + ID_Fichas := TStringList.Create; + ID_Fichas.CommaText := AFichaID; + + //Vamos generando todos y cada uno de las fichas de empleado + for i := 0 to ID_Fichas.Count - 1 do + GenerarFicha(StrToInt(ID_Fichas.Strings[i])); + + frxReport.PreviewPages.SaveToStream(Result); + + finally + FConnection.RollbackTransaction; + end; +end; + +procedure TRptFichasEmpleado.GenerarFicha(const ID: integer); +var + AStream: TMemoryStream; + dsMaster: IDADataset; +begin + AStream := TMemoryStream.Create; + + try + dsMaster := schReport.NewDataset(FConnection, ds_InformeFichaEmpleado, ['ID'], [ID]); + + AStream.Clear; + DABINAdapter.WriteDataset(AStream, dsMaster, [woRows, woSchema], -1); + DABINAdapter.ReadDataset(AStream, tbl_FichaEmpleado, TRUE, '', TRUE, TRUE); + + frxReport.LoadFromFile(DarRutaInformes + rptFichaEmpleado, True); + frxReport.PrepareReport(False); + + finally + AStream.Free; + dsMaster := Nil; + end; +end; + +end.