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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't get a Crystal Report to Preview from VFP

Status
Not open for further replies.

LeonelSanchezJr

Programmer
Jan 26, 2001
522
0
0
US
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 ;-)
 
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.
 
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.


 
Hello,

There is a really good article on this subject at

(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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top