report via Email

  • Thread starter Thread starter touf
  • Start date Start date
T

touf

hi,
1- I've a report (Crystal reports) created from a vb Form
(crystalReportsViewer)
How can I send it via email , In crystal report there is the possibility to
export, but I didn't find a way to send it by email.

2- I've also post a quetion for few days but didn't receive answer: How can
I display a text (invoice number) at th top of all pages of my report, I've
a report header and page header (that contain other informations) , the
problem is that in th first page the report header is on top and the page
header under it.

Thanks for your help.
 
The following code loads the report, export it to PDF format, and send it
through mail.

try this............

Dim myExportOpts as ExportOptions
Dim myMailOpts as new MicrosoftMailDestinationOptions

Dim crReportDocument As New ReportDocument()

crReportDocument.Load(ReportFileName)


'Get reference to Export options object from the current report
myExportOpts = crReportDocument.ExportOptions

myExportOpts.ExportFormatType = ExportFormatType.PortableDocFormat

myExportOpts.ExportDestinationType = ExportDestinationType.MicrosoftMail

'Set Mail options

myMailOpts.MailMessage = "Assign the Message Value here"

myMailOpts.MailToList = (e-mail address removed)

myMailOpts.MailSubject = "Mail Subject"

'Send reference of Mail Options object to ExportOptions

exportOpts.DestinationOptions = myMailOpts

'Export the Report

crReportDocument.Export()

Good Luck!
 
Hi Touf,

Re your second question: don't use the report header, or if you must, change
the section expert section to have a 'page after' report header - thus, the
report header will only appear as an opening intro to the report - have the
invoice # be part of the page header: it will be on every page.

HTH,
Bernie Yaeger
 
Hi, thanks for your help
1- I need to send email from Crystal itself, so the user when he see the
report an check it he can email it (like export)

2- I've found a way to do this: I've created a section containing the
invoice # in the report header and the same in the page header, then I've
suppressed the page header one for the first page.

I works.
 
Back
Top