Load report in Windows Service
I want to generate a PDF file in the Windows Service. I use Delphi XE2 with FastRepor 4.12.2.
On the line where loaded from the database, the service is completely stops. After uninstall service generates a blank PDF.
Thanks for the advice.
On the line where loaded from the database, the service is completely stops. After uninstall service generates a blank PDF.
LoadFromBlobField(frxReport, QuerySestava.FieldByName('obsah'));
procedure TSAODV.LoadFromBlobField(frxReport: TfrxReport; Blob: TField);
var Stream: TMemoryStream;
begin
  Stream := TMemoryStream.Create;
  try
    TBlobField(Blob).SaveToStream(Stream);
    Stream.Position := 0;
    frxReport.LoadFromStream(Stream);
  finally
    Stream.Free;
  end;
end;
I tried the code below does not work.frxReport.LoadFromStream(QuerySestava.CreateBlobStream(TBlobField(QuerySestava.FieldByName('obsah')),bmRead));
The above lines in the standard program are OK.Thanks for the advice.
Comments
Thanks, it all works OK.
Hello,
Almost OK.
CreateBlobStream() returns a stream that you need to free. Especially if, I assume, this is a server.
Best Regards,
Cristian Peta