I have instance of StiReport. I need open email client with this report as PDF attachment and with specific "To-address" and "Subject" fields.
I know about export services, about Export(report, file, email) method, but it seems there is no way to specify address and subject? Am I wrong?
The second question: how to add custom button to preview window opened with RenderWithWpf() or RenderWithWpfRibbonUI() ?
Sending email with attachment to specific address
-
- Posts: 1
- Joined: Thu Sep 08, 2016 2:21 pm
Re: Sending email with attachment to specific address
Hello,
You can try to use StiOptions.Engine.GlobalEvents.InvokeSendEMailProcess method. It is called before trying to send email and if you set CallStandardHandler property to false you could implement your own method to send reports.
Thank you.
You can try to use StiOptions.Engine.GlobalEvents.InvokeSendEMailProcess method. It is called before trying to send email and if you set CallStandardHandler property to false you could implement your own method to send reports.
Code: Select all
StiOptions.Engine.GlobalEvents.SendEMailProcess += new Stimulsoft.Report.Events.StiSendEMailEventHandler(GlobalEvents_SendEMailProcess);
StiReport report = new StiReport();
report.Load(@"d:\Report.mrt");
report.Compile();
report.Render();
report.Show();
.....
private void GlobalEvents_SendEMailProcess(object sender, Stimulsoft.Report.Events.StiSendEMailEventArgs e)
{
e.CallStandardHandler = false;
//send email using MAPI or other methods
//......
}