Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Corrupt Object?
Message
General information
Forum:
Visual FoxPro
Category:
Crystal Reports
Title:
Corrupt Object?
Miscellaneous
Thread ID:
00689296
Message ID:
00689296
Views:
91
I'm trying to integrate Crystal Reports into VFP for the first time. I've got version 8.5 and am using VFP 7.0 with the SP installed. I've created a real basic report in Crystal and am trying to get a preview of it. I can print it programatically without a problem - but can't seem to get the preview to work correctly.

I'm using the Crystal Report Viewer ActiveX control on a basic form. I've added this code (From Craig's Essential Fox session) to the INIT of the form:

LOCAL cr AS CRViewer.crViewer

WITH This
.WindowState = 2
.oCrystal = CREATEOBJECT("CrystalRuntime.Application")
.oReport = .oCrystal.OpenReport("c:\mc\crystal reports\rptwork.rpt")

WITH thisform.oleCRViewer
.EnableExportButton = .T.
.EnableProgressControl = .T.
.ReportSource = ThisForm.oReport
.EnableAnimationCtrl = .F.
.ViewReport()
ENDWITH
.Visible = .T.
ENDWITH

and this to the RESIZE method:

with thisform.oleCRViewer
.top = 1
.left = 1
.height = this.Height - 2
.width = this.Width - 2
endwith

When I run the form, I get this message - "OLE exception error: Exception code c0000005. OLE object may be corrupt." After I click "Ok" on the message, everything works fine (except that I can't export in PDF - which is another issue I'll ask about later).

I've uninstalled and reinstalled Crystal Reports - that didn't help any. Basically, I'm hoping someone can help me identify what the problem is.

If I put a "SET STEP ON" at the end of the INIT code, I don't get the error message...
Next
Reply
Map
View

Click here to load this message in the networking platform