You are not logged in.
Pages: 1
Hi,
I am generating a report on the server side with FastReport. How do I send the generated report to the client through the following function:
ILongWorkCallback = interface(IInvokable)
['{C443AF11-E137-43D3-AB75-1CEC17FE30B2}']
procedure WorkFinished(const worktype : Integer;
timeTaken: integer;
const AResult: ??????);
Offline
You could use RawByteString, but it would use Base64 encoding during the transport.
An alternative may be to supply an ID of the report, then download the content from the main service, directly as binary using http://synopse.info/files/html/Synopse% … #TITLE_434
Offline
Thanks for the feedback.
so I used and it worked:
Interface:
ILongWorkCallback = interface(IInvokable)
['{C443AF11-E137-43D3-AB75-1CEC17FE30B2}']
procedure WorkFinished(const worktype : Integer;
timeTaken: integer;
const AResult: RawByteString);
Server:
AStream: TRawByteStringStream
frxPDFExport.Stream := AStream;
frxPDFExport.ShowDialog := False;
frxReport.PrepareReport(True);
frxReport.Export(AfrxPDFExport);
AStream.seek(0,soBeginning);
fCallback.WorkFinished(fWorktype,GetTickCount64 - ftix,AStream.DataString);
Client:
v_Stream : TMemoryStream;
v_Stream := TMemoryStream.Create;
WriteStringToStream(v_Stream,AResult);
v_Stream.Position := 0;
v_Stream.SaveToFile(v_filename);
v_Stream.Free;
Offline
Pages: 1