Esport JPG in separate file for mail
Hello to all,
From a report I have to export in jpeg separate file the result and add all the file to a Mail.
I Don't want to save the Jpg into a file but in stream and attach to the mail (I'm using Indy)
I'm using this code:
Report.LoadFromFile('myreport.fr3');
lStream := TMemoryStream.Create;
try
frxJPEGExport1.Stream := lStream;
frxJPEGExport1.SeparateFiles := true;
Report.PrepareReport;
// export the jpg files in the stream
Report.Export(frxJPEGExport1);
lAttach := TAttach.create;
lStream.Position := 0;
(lAttach.Attach as TMemoryStream).LoadFromStream(lStream);
lAttach.Nome := 'my image.jpg';
lAttaches.Add(lAttach);
finally
lStream.free;
end;
How can I create n separate file in separate stream?
Thanks
Omar
From a report I have to export in jpeg separate file the result and add all the file to a Mail.
I Don't want to save the Jpg into a file but in stream and attach to the mail (I'm using Indy)
I'm using this code:
Report.LoadFromFile('myreport.fr3');
lStream := TMemoryStream.Create;
try
frxJPEGExport1.Stream := lStream;
frxJPEGExport1.SeparateFiles := true;
Report.PrepareReport;
// export the jpg files in the stream
Report.Export(frxJPEGExport1);
lAttach := TAttach.create;
lStream.Position := 0;
(lAttach.Attach as TMemoryStream).LoadFromStream(lStream);
lAttach.Nome := 'my image.jpg';
lAttaches.Add(lAttach);
finally
lStream.free;
end;
How can I create n separate file in separate stream?
Thanks
Omar
Comments