Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Donate Today!

Do you enjoy these
technical forums?
Donate Today! Click Here

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Can't get a Crystal Report to Preview from VFP

LeonelSanchezJr (Programmer) (OP)
25 Sep 01 14:48
Here's the code I've been told from Tek-tips that should work to PREVIEW a Crystal Report, but I can't get it to work.

I get the following error:
"Class Definition CRYSTAL.CRPRE.APPLICATION is not found" with the code below.

*** You have to create the report object ...
loCrystalRp = Createobject("Crystal.CRPE.Application")

lcReport = "c:\temp\VFPReport.RPT"
loRp = loCrystalRp.OpenReport(lcReport)
loPrev = loRp.Preview

I need to keep this as simple as possible and the Preview must be able to Export.  Thanks.




Thanks,

Leo   

spectrum42 (Programmer)
25 Sep 01 18:00
I made a simple Crystal Reports rpt file and used your code to preview the report. No errors here, but I remember getting an error similar to what you report once. Have you read the runtime.hlp file that comes with Crystal Reports?  It lists some DLL files that you need to have on your system, for example:

crpe32.dll
cpeaut32.dll
oleaut32.dll
mfc42.dll  
msvcrt.dll

You may need to register the files with regsvr32 in Windows before things start working right. (Go to start button, choose run, type: regsrv32 crpe32.dll)

Hope this helps.
Nro (Programmer)
25 Sep 01 20:37
Ha ben mon vieux !

If I understand, you try to print a report from a client machine where no crystal is installed (Am I right?) If so, you'll have to install those DLL files. What I usually do is to create a Visual Basic project with all the crystal objects in it (Crystal viewers, OCX ...) compile it and create a package to distribute with the "Package & Deployment Wizard". You have to "Install" the package on each client machine to register the DLLs.

VB is always better to register a DLL in the registry.

If you have Visual studio 6.0 or VB 6 ...

If not, I think you'll have to register manually each DLL, using REGSVR32.

The list of DLL is in the "C:\Program Files\Seagate Software\Crystal Reports\Developer Files\Help\Crystal reports Developer Runtime Help"

If you are using VFP 7.0, maybe it's more efficient with InstallShield, but I did not try that.

Bonne chance.

P.S. I hope that you install all the Developers components from the Crystal CD. If you still have problem register or distribute Crystal application, take a look at the Crystal forum. Distributing crystal runtime is not a Fox problem, but a Crystal Report problem.

N.

 
 
Raven123 (Programmer)
26 Sep 01 13:16
Hello,

There is a really good article on this subject at

http://www.pinnaclepublishing.com (go to FoxTalk area)

The article is "Using Crystal Reports 7 with VFP 6" featured in the 11/1999 edition, written by Nigel Reburn.

He includes a download that has a set-up (created in VB) that properly installs all the necessary .Dlls and registers them on client machines (****They are for Crystal version 7 though!****)

Hope this helps,

Rich.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close