• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 916
  • Last Modified:

Problems emailing using Crystal ActiveX Control

Hi,

I am having a serious problem since I upgraded to Crystal 7.0. My program now seems to be behaving very weirdly whenever I try to email out a report. I am using Visual Basic 6.0 on Winme using an Access database via ODBC for the development platform

I don't know whether any of you have experienced this before, but my application would be able to email out for the very first time, then after that, when I try to email again, I would always get an error message

"20545     User Has Canceled Operation.     The user has clicked the Cancel button in a dialog box during the session.". Funny thing is I did not touch anything...

I have to shut down the application and start it again, then it will behave exactly in the same manner. Very weird. However, when I check my Outlook Outbox, I can see the email there. Weird!!!

When I was using Crystal 5.0, I did not face this problem.
I tried to export to MAPI from the Crystal Report Designer, and it work without any problem, which shows my MAPI has been configured properly. So what the hell is wrong here??? Is it a bug?

Here is the sample code I am using. Report1 is the name of the Crystal Reports ActiveX component.

  Report1.ReportFileName = "C:\TEST.RPT"
  Report1.Destination = crptMapi
  Report1.PrintFileType = crptCrystal
  Report1.PrintFileName = PathName.Text
  Report1.EMailToList = "TEST@TEST.COM"
  Report1.EMailCCList = ""
  Report1.EMailSubject = "HELLO"
  Report1.EMailMessage = "MESSAGE BODY"
  Report1.Action = 1

It looks correct isn't it? I don't see any problems with it, since the report could print to the printer and screen.

Please help as I have been trying to solve this problem for the past 2 weeks. I have tried opting to use the CRPE API engine, but the manual says I cannot use the CRPE and the ActiveX control in the same application, and the CRPE engine seems to be very much complicated to use then the ActiveX component.

Please give me a solution, anything to solve this mystery.

Thanks a lot.
0
dinoang22
Asked:
dinoang22
  • 4
  • 3
1 Solution
 
jrmnCommented:
Hi dinoang22,

Try reading these k-base articles from crystal reports site. Maybe one of these will solve you problem :

http://support.seagatesoftware.com/library/kbase/articles/C2002185.asp
http://support.seagatesoftware.com/library/kbase/articles/C2002181.asp

Goodluck,
jrmn
0
 
dinoang22Author Commented:
Hi jrmn,

Thanks for the info. The article

http://support.seagatesoftware.com/library/kbase/articles/C2002185.asp

answered the problem I was facing. So indeed it was a problem with Crystal Reports 7 and not my program code. This is really annoying, seagate software should have made their codes backward compatible. The solution given by them would have to code the MAPI profile into your source code. Of course I could have added a MAPI setup first in my program, but it too troublesome since my customer is already using the software in 4 countries.

I tried the code provided but I still am getting the same error message. I'm wondering why?  The suggested code was :-

Dim ol As New Outlook.Application
Dim ns As Outlook.NameSpace
'Return a reference to the MAPI layer
Set ns = ol.GetNamespace("MAPI")
'Logon to Outlook and then create a new session
'The first argument in the Logon method will be the name of your MAPI profile (i.e. Outlook Profile)
ns.Logon "MS MAPI Settings", "", False, True

I am seeking a new way to overcome this using the CRPE API engine. Its exactly the same engine that the Crystal Report Designer program is using.

I believe everyone who is using the Export function to MAPI is facing this problem. Does Seagate have a patch or something?

Anyway, thanks for the help. Any comments would be welcome.
0
 
jrmnCommented:
Hi dinoang22,

There's another article related to this problem but this is for automation server. Just read this you might get some ideas here:

http://support.seagatesoftware.com/library/kbase/articles/C2005009.asp

Actually, there are various updates for crystal reports 7 but I'm not sure if they'll fix the problem you have above.
There are lot of new stuffs in version 8 and 8.5 but I can't guarantee if these new versions will solve your problem as I haven't done the thing you presented here.
Perhaps other experts can give you a sort of an "overview" later on if your problem can be solve with the latest version.
 
Anyway, if you're intested enough, check the links below as these leads you to update files for crystal reports 7.0 :

http://support.crystaldecisions.com/communityCS/FilesAndUpdates/mr1.htm
http://support.crystaldecisions.com/communityCS/FilesAndUpdates/SR293_7010192.zip.asp
http://support.crystaldecisions.com/communityCS/FilesAndUpdates/expt_vim.zip.asp
http://support.crystaldecisions.com/communityCS/FilesAndUpdates/p2smon701008.exe.asp
http://support.crystaldecisions.com/communityCS/FilesAndUpdates/crdb2bind.zip.asp
http://support.crystaldecisions.com/communityCS/FilesAndUpdates/p2lodbc.zip.asp
http://support.crystaldecisions.com/communityCS/FilesAndUpdates/19898.zip.asp

Goodluck,
jrmn

0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
dinoang22Author Commented:
Hi Jrmn,

Thanks for the Info. I'll try the patches and see. Anyway, I got the earlier code working. However, I have to declare the MAPI profile inside the VB code. I was thinking of adding a MAPI setup in my program to allow the user to select the MAPI profile of their choice before emailing using Crystal Reports.

Do you know how to list the MAPI profile of a machine in VB 6?

Thanks a lot
0
 
jrmnCommented:
Hi dinoang22,

Unfortunately, I don't have any experience programming using VB as I'm using Delphi as a development tool.

I went to the Visual Basic area on EE and search for any topic related to MAPI. Well, I found a lot of it there.
Just take a look for yourself and see which of those topics suits your need.

I'm glad to hear that you have "partially" solve your problem. :-)

I'll make this comment an answer in the assumption that it helped you in a way or 2 and that other users can get something from this one later on in case they'll encounter the same or similar problem.

Just reject it if you feel the solutions I gave you doesn't help you at all...it's fine with me :-)

Cheers,

jrmn
0
 
jrmnCommented:
Opps, I forgot to mark my previous entry as an answer..sorry  ;-)
0
 
dinoang22Author Commented:
Hi jrmn,

Your solution provided me an insight on how to solve the problem. The article which you asked me to view at

http://support.seagatesoftware.com/library/kbase/articles/C2002185.asp

seems to have provided me a clue and with some additional research, I was able to get my application and Crystal Reports working with MAPI.

Again, thanks for the help. It has really ease my nerve on this issue and I can move on.

Cheers dude, you deserve the points.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now