unit srvPagos_Impl; {----------------------------------------------------------------------------} { This unit was automatically generated by the RemObjects SDK after reading } { the RODL file associated with this project . } { } { This is where you are supposed to code the implementation of your objects. } {----------------------------------------------------------------------------} interface uses {vcl:} Classes, SysUtils, {RemObjects:} uROClientIntf, uROTypes, uROServer, uROServerIntf, uROSessions, {Ancestor Implementation:} DARemoteService_Impl, {Used RODLs:} DataAbstract_Intf, {Generated:} FactuGES_Intf, uDAScriptingProvider, uDABusinessProcessor, uDAClasses, uDADataTable, uDACDSDataTable, frxClass, frxDBSet, DB, uDAInterfaces, uDABINAdapter; type { TsrvPagos } TsrvPagos = class(TDARemoteService, IsrvPagos) bpPagos: TDABusinessProcessor; frxDBCabecera: TfrxDBDataset; tbl_Pagos: TDACDSDataTable; DADataCabecera: TDADataSource; frxReport1: TfrxReport; DABINAdapter: TDABINAdapter; schPagos: TDASchema; private protected function GetNextAutoinc: Integer; function GenerateReport(const Codigo: Integer): Binary; end; implementation {$R *.dfm} uses {Generated:} FactuGES_Invk, uDataModuleServer; procedure Create_srvPagos(out anInstance : IUnknown); begin anInstance := TsrvPagos.Create(NIL); end; { srvPagos } function TsrvPagos.GenerateReport(const Codigo: Integer): Binary; var dsMaster: IDADataset; AStream: TMemoryStream; begin AStream := TMemoryStream.Create; Result := Binary.Create; try dsMaster := schPagos.NewDataset(Connection, 'InformeCabeceraPago', ['CODIGO'], [Codigo]); // dsDetail.Active := True; AStream.Clear; ServiceAdapter.WriteDataset(AStream, dsMaster, [woRows, woSchema], -1); ServiceAdapter.ReadDataset(AStream, tbl_Pagos, TRUE, '', TRUE, TRUE); frxReport1.LoadFromFile(DarRutaInformes + 'InfRecibo.fr3', True); frxReport1.PrepareReport; frxReport1.PreviewPages.SaveToStream(Result); finally AStream.Free; end; end; function TsrvPagos.GetNextAutoinc: Integer; begin Result := uDataModuleServer.GetNextAutoinc(Connection, 'GEN_PAGOS'); end; { srvPagos } initialization TROClassFactory.Create('srvPagos', Create_srvPagos, TsrvPagos_Invoker); finalization end.