Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Email Reports as Attachment using VB6?

Status
Not open for further replies.

week

MIS
Feb 14, 2001
118
US
Hi all,

I am trying to email Crystal Reports (v8.5) as an attachment in VB6. I am sure many of you have done this before. Can anyone help?

Thanks you so much in advance....
 
From the CD KB:

CrystalReport1.ReportFileName = "C:\aReport.rpt"
CrystalReport1.Destination = crptMapi
CrystalReport1.PrintFileType = crptHTML32Std
CrystalReport1.EMailToList = "Customer@somewhere.com"
CrystalReport1.PrintFileName = "C:\Temp\YourReport.html"
CrystalReport1.Action = 1

This exports in HTML format.

-k kai@informeddatadecisions.com
 
I coded something very similar to what you suggested, but it never likes variables like crptHTML32Std or crptMapi. It says variable undefined. What's up with that? What do I declare with?
 
How are you setting CrystalReport1?

Thanks...
 
Ok, I got this far and following is working except, it doesn't like DestinationType = 2 which is for Email option and the most important property I need to set. We use Crystal 8.5 here which I believe supports the email function. Any idea how I can make this work?????

'objExportOptions.DestinationType = 2
objExportOptions.MailToList = vAddress
objExportOptions.MailSubject = "Report file requested from the system"
objExportOptions.MailMessage = "Here is the document..."
objExportOptions.FormatType = 21

Thanks!!
 
Let me ask you this (or anybody who could answer these questions,) synapsevampire..
What's your CrystalReport1 defined as?
What's exactly crptMapi? Is it something generic for everyone?

Is anybody working? Thanks.
 
1) you need Cr8.5 developer edition to get the required objects and help.
2) You need a reference to CRAXDRT.DLL in your VB project. It is described as the "Crystal Reports 8.5 ActiveX Run Time Library).

(You do NOT need CRAXDDRT.DLL - the Crystal Reports 8.5 ActiveX DESIGNER Run Time Library. It is for report design via VB and has license costs if you distribute your App to others)

Then the references in the prior messages will make sense.
Editor and Publisher of Crystal Clear
 
I AM PRESENTLY TRYING TO DO A EMAIL SENDING OF THE REPORT GENERATING THROUGH CRYSTAL REPORTS THROUGH A VB CODE .(PREPARING A DLL WHICH WILL FETCH THE YESTERDAY DATE AND SEND A REPORT TO THE USER ACCORDINGLY).
I HAVE DESIGNED THE REPORT ALREADY IN CYRSTAL REPORT AND ALREADY DONE THE INTEGRATION BUT THE RESULT IS GENERATED ON MY WINDOW SCREEN INSTEAD WANT TO SEND IT TO A EMAIL ADDRESS.
 
Are you using the OCX or the RDC?

The RDC is the better method. You will need CRAXDRT as a reference in your VB program and do NOT use Crystal32.OCX.

It looks like you are using the OCX. I'm not sure if that can be used for exporting a report. It is a Crystal Viewer only. Editor and Publisher of Crystal Clear
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top