Custom Email Processing don't work as expected
Posted: Mon Nov 30, 2015 1:07 pm
Stimulversion: 2014.3.0.0
Win 8.1
.NET 4.0
Office 2013
Hello, I have some problems with customizing the Email-Processing.
The goal is to "disable" the Save-Dialog after clicking SendEmail by creating a temporary file.
So far I generate a StiPreviewForm with my ReportObject and register a special ProcessSendEmail procedure:
This code works partly as expected, but if I exit the Emailing-Window of Outlook by Close-Button, a secound Emailing-Window without any email attachments opens.
It seems like the ProcessSendEmail proceed with the standard SendEmail-procedure if the first time is canceled.
Is there a way to suppress this behavior?
Win 8.1
.NET 4.0
Office 2013
Hello, I have some problems with customizing the Email-Processing.
The goal is to "disable" the Save-Dialog after clicking SendEmail by creating a temporary file.
So far I generate a StiPreviewForm with my ReportObject and register a special ProcessSendEmail procedure:
Code: Select all
var previewForm = new StiPreviewForm(m_ReportObject);
previewForm.ViewerControl.ProcessSendEMail += CustomSendEmailProcessing;
m_ReportObject.ViewerControl = previewForm.ViewerControl;
if (asDialog)
{
previewForm.ShowDialog();
}
else
{
previewForm.Show();
}
Code: Select all
private void CustomSendEmailProcessing(object sender, EventArgs e)
{
var service = sender as StiExportService;
if (service != null)
{
var temp = Path.Combine(Path.GetTempPath(), Path.GetFileNameWithoutExtension(m_ReportObject.ReportFile) + DateTime.Now.ToString("dd-MM-yyyy_HH-mm-ss")
+ "." + service.DefaultExtension);
service.Export(m_ReportObject, temp, true);
File.Delete(temp);
}
}
It seems like the ProcessSendEmail proceed with the standard SendEmail-procedure if the first time is canceled.
Is there a way to suppress this behavior?