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

Comments

  • gpigpi
    edited 1:45PM
    pass trough TfrxReport.PreviewPages and export each page (set TfrxJPGExport.PageNumbers)

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.