Symptom
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#
Resolution
Sample://Reference to Assemblies
using CrystalDecisions.CrystalReports.Engine;using CrystalDecisions.Shared;using CrystalDecisions.Windows.Forms;
//ReportDocument DeclarationReportDocument crreportdocument;//Create an Instance of the ExportOptionsExportOptions crexportoptions = new ExportOptions();
//Exchange mail settings AccountMicrosoftMailDestinationOptions 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 ReportDocumentcrreportdocument = new ReportDocument();// Load the Reportcrreportdocument.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 Typecrexportoptions = crreportdocument.ExportOptions;
crexportoptions.ExportDestinationOptions = crexchange;crexportoptions.ExportFormatType = ExportFormatType.CrystalReport;
crexportoptions.ExportDestinationType = ExportDestinationType.MicrosoftMail;// Export to MAPIcrreportdocument.Export(crexportoptions);
For more information about the CrystalReport .NET SDK, refer to the devLibrary: http://help.sap.com/businessobject/product_guides/boexir31/en/crsdk_net_apiRef_12_en.chm
See Also
SAP Note 1326487 - How to export a Crystal Report to MAPI destination in Visual Studio .NET
Keywords
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
Product
SAP Crystal Reports, developer version for Microsoft Visual Studio
SAP Knowledge Base Article - Public