SAP Knowledge Base Article - Public

1295243 - How to export to MAPI using CRYSTALREPORT .NET SDK


How to export to MAPI using CRYSTALREPORT .NET SDK

Reproducing the Issue

Environment information

·        Windows 2003 (x86) Server SP1

·        Crystal Report XI, XI R2, 2008 Developer

·        .NET Framework 1.1, 2.0

·        C#


//Reference to Assemblies
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using CrystalDecisions.Windows.Forms; 
//ReportDocument Declaration
ReportDocument crreportdocument;
//Create an Instance of the ExportOptions
ExportOptions crexportoptions = new ExportOptions(); 
//Exchange mail settings Account
MicrosoftMailDestinationOptions crexchange = new MicrosoftMailDestinationOptions();
crexchange.MailToList = "destination email address";
crexchange.MailSubject = "this is a test";
crexchange.MailMessage = "This is a test"; 
// Create an instance of the ReportDocument
crreportdocument = new ReportDocument();
// Load the Report
crreportdocument.Load(@"C:\Program Files\Business Objects\BusinessObjects Enterprise 11.5\Samples\en\Reports\General Business\Employee Sales.rpt", OpenReportMethod.OpenReportByTempCopy);
// Setting the export destination Option and Export Format Type
crexportoptions = crreportdocument.ExportOptions; 
crexportoptions.ExportDestinationOptions = crexchange;
crexportoptions.ExportFormatType = ExportFormatType.CrystalReport; 
crexportoptions.ExportDestinationType = ExportDestinationType.MicrosoftMail;
// Export to MAPI
For more information about the CrystalReport .NET SDK, refer to the devLibrary:

See Also

SAP Note 1326487 - How to export a Crystal Report to MAPI destination in Visual Studio .NET


How to export to MAPI using CRYSTALREPORT .NET SDK, export to MAPI, CRYSTALREPORT .NET , KBA , BI-DEV-NET , BI Software Development Kits (SDKs) - .NET or Other , How To


SAP Crystal Reports, developer version for Microsoft Visual Studio