Skip to Content
0
Former Member
Mar 16, 2013 at 01:43 PM

Problems with Crystal Reports, System 7 and Email

35 Views

I have read a number of posts and followed a number of dead-ends.

I am trying to export a Crystal report from a VB environment in VisualStudio 2012 to a Microsoft email client. I have read reports that the problem I am experiencing is probably due to MS no longer supporting a simple email export interface. I have installed CRforVS_13_0_5 and it is working fine in all other respects, but this email issue remains unresolved for me.

I have tried substituting an XP version of mapi32.dll into C:\Windows\SysWOW64 to no avail.

I have set up the mail and export options as follows:


Dim pdfOpts As PdfRtfWordFormatOptions = ExportOptions.CreatePdfRtfWordFormatOptions()
pdfOpts.UsePageRange = False

Dim exportOpts As New CrystalDecisions.Shared.ExportOptions
exportOpts = rptStatement.ExportOptions
exportOpts.ExportFormatOptions = pdfOpts

' Set the PDF format options.
exportOpts.ExportFormatType = ExportFormatType.PortableDocFormat
exportOpts.ExportDestinationType = ExportDestinationType.MicrosoftMail

' Set the mail options.
Dim mailOpts As New CrystalDecisions.Shared.MicrosoftMailDestinationOptions
mailOpts.MailCCList = ""
mailstr = "Your Statement is attached as a PDF document"
mailOpts.MailMessage = mailstr
mailOpts.MailSubject = "test"
mailOpts.MailToList = emailadd
mailOpts.Password = officepw.Text '"fish4u" '"yucatan1"
mailOpts.UserName = "jjoeblow@pacbell.net"
exportOpts.ExportDestinationOptions = mailOpts
Try
rptStatement.Export(exportOpts)
Catch ex As Exception
MessageBox.Show(ex.ToString())
Return

This the intractable error I receive:

System.AccessViolationException was caught

HResult=-2147467261

Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Source=CrystalDecisions.CrystalReports.Engine

StackTrace:

at CrystalDecisions.CrystalReports.Engine.STACaller.Call()

at CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportStreamToMAPI(Stream stream, MicrosoftMailDestinationOptions options, String name)

at CrystalDecisions.CrystalReports.Engine.FormatEngine.Export(ExportRequestContext reqContext)

at CrystalDecisions.CrystalReports.Engine.ReportDocument.Export(ExportOptions options)

at MF.CustStatement.sendemail_Click(Object sender, EventArgs e) in C:\Users\User\Documents\Visual Studio Projects\MFOff\CustStatement.vb:line 670

InnerException:

Any suggestions would be greatly appreciated.

Jon

0 Views