git-svn-id: https://192.168.0.254/svn/Proyectos.EstudioCarnicero_ProGestion/trunk@4 1b8572a8-2d6b-b84e-8c90-20ed86fa4eca
81 lines
2.5 KiB
ObjectPascal
81 lines
2.5 KiB
ObjectPascal
unit srvRecibosCliente_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, uDADataTable,
|
|
uDACDSDataTable, DB, frxClass, frxDBSet, uDAClasses, uDABINAdapter, uDAInterfaces;
|
|
|
|
type
|
|
{ TsrvRecibosCliente }
|
|
TsrvRecibosCliente = class(TDARemoteService, IsrvRecibosCliente)
|
|
DABINAdapter: TDABINAdapter;
|
|
frxDBCabecera: TfrxDBDataset;
|
|
DADataCabecera: TDADataSource;
|
|
tbl_RecibosCliente: TDACDSDataTable;
|
|
schRecibosCliente: TDASchema;
|
|
frxReport1: TfrxReport;
|
|
private
|
|
protected
|
|
{ IsrvRecibosCliente methods }
|
|
function GetNextAutoInc: Integer;
|
|
function GenerateReport(const Codigo: Integer): Binary;
|
|
end;
|
|
|
|
implementation
|
|
|
|
{$R *.dfm}
|
|
uses
|
|
{Generated:} FactuGES_Invk, uDataModuleServer;
|
|
|
|
procedure Create_srvRecibosCliente(out anInstance : IUnknown);
|
|
begin
|
|
anInstance := TsrvRecibosCliente.Create(NIL);
|
|
end;
|
|
|
|
{ srvRecibosCliente }
|
|
function TsrvRecibosCliente.GetNextAutoInc: Integer;
|
|
begin
|
|
Result := uDataModuleServer.GetNextAutoinc(Connection, 'GEN_RECIBOSCLIENTE');
|
|
end;
|
|
|
|
function TsrvRecibosCliente.GenerateReport(const Codigo: Integer): Binary;
|
|
var
|
|
dsMaster: IDADataset;
|
|
AStream: TMemoryStream;
|
|
begin
|
|
AStream := TMemoryStream.Create;
|
|
Result := Binary.Create;
|
|
try
|
|
dsMaster := schRecibosCliente.NewDataset(Connection, 'InformeReciboCliente', ['CODIGO'], [Codigo]);
|
|
|
|
AStream.Clear;
|
|
ServiceAdapter.WriteDataset(AStream, dsMaster, [woRows, woSchema], -1);
|
|
ServiceAdapter.ReadDataset(AStream, tbl_RecibosCliente, TRUE, '', TRUE, TRUE);
|
|
|
|
frxReport1.LoadFromFile(DarRutaInformes + 'InfReciboCliente.fr3', True);
|
|
frxReport1.PrepareReport;
|
|
frxReport1.PreviewPages.SaveToStream(Result);
|
|
finally
|
|
AStream.Free;
|
|
end;
|
|
end;
|
|
|
|
initialization
|
|
TROClassFactory.Create('srvRecibosCliente', Create_srvRecibosCliente, TsrvRecibosCliente_Invoker);
|
|
|
|
finalization
|
|
|
|
end.
|