Email report without "Save file" dialog
Email report without "Save file" dialog
Hello,
is it possible to send a report via email as attachement without getting the "Save file" dialog?
It is ok for me to choose the export format for the mail attachement, but then i'd like to save the exported report in the system temp path (override it if it still exists) and use this temp path document as attachement for the email. This is because i don't want the user to choose his own export path and don't want him to decide if existing files should be overriden or not. By this the user has at least two clicks and dialogs fewer if he wants to send a report by email.
Thanks
Thorsten Pontow
is it possible to send a report via email as attachement without getting the "Save file" dialog?
It is ok for me to choose the export format for the mail attachement, but then i'd like to save the exported report in the system temp path (override it if it still exists) and use this temp path document as attachement for the email. This is because i don't want the user to choose his own export path and don't want him to decide if existing files should be overriden or not. By this the user has at least two clicks and dialogs fewer if he wants to send a report by email.
Thanks
Thorsten Pontow
Last edited by tpontow on Fri Nov 30, 2012 8:53 am, edited 1 time in total.
Thorsten Pontow
It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
Re: Email report without "Save file" dialog
Hello,
As a way, you can try to subscribe on the StiOptions.Engine.GlobalEvents.SendEMailProcess event and try to realize your method for sent email.
Thank you.
As a way, you can try to subscribe on the StiOptions.Engine.GlobalEvents.SendEMailProcess event and try to realize your method for sent email.
Thank you.
Re: Email report without "Save file" dialog
Hello Aleksey,
thanks for your quick response. I will try it the way you suggested and then i will come back to you.
Thanks
Thorsten
thanks for your quick response. I will try it the way you suggested and then i will come back to you.
Thanks
Thorsten
Thorsten Pontow
It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
Re: Email report without "Save file" dialog
Hello,
Ok.
Let us know if you need any additional help.
Thank you.
Ok.
Let us know if you need any additional help.
Thank you.
Re: Email report without "Save file" dialog
Hello Aleksey,
unfortunately the SendEMailProcess event fires after the "Save file" dialog and that is too late. But with that event it is possible for me to change Subject and Body of the created email, which i needed too.
I solved my problem in another way. Here in our framework we have our own viewer window in which the StiViewerControl is one part of. We don't show the toolbar of the viewer but have our own custom menus. So we have menu items for sending reports as email. With that i can call the Export() method of the regarding ExportService in my own code and set my own file name. With that no save file dialog is displayed.
For example pdf email goes like this:
So thanks for your help. Your post put me on the right track!
Thorsten
unfortunately the SendEMailProcess event fires after the "Save file" dialog and that is too late. But with that event it is possible for me to change Subject and Body of the created email, which i needed too.
Code: Select all
//Lamdba expresssion is used here...
StiOptions.Engine.GlobalEvents.SendEMailProcess += (sender, args) =>
{
args.Subject = "Ihr Report";
args.Body = "Fügen Sie hier Ihre Nachricht ein.";
};
For example pdf email goes like this:
Code: Select all
string myFileName = Path.Combine(Path.GetTempPath(), "Report.pdf");
StiPdfExportService stiPdfExportService = new StiPdfExportService();
stiPdfExportService.Export(Report, myFileName, sendEMail:true);
Thorsten
Thorsten Pontow
It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
Re: Email report without "Save file" dialog
Hello,
Let us know if you need any additional help.
Thank you.
Let us know if you need any additional help.
Thank you.