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

VFP 7.0 and Crystal Report preview report error 1

Status
Not open for further replies.

bettyfurr

Technical User
Joined
Mar 12, 2002
Messages
371
Location
US

I think I have my editing correct to preview my report.

I created my report in crystal report. Looks terrible. Still don't have the hang of moving the data, but that isn't this problem.

When I ran my preview form in the command window, it seemed to flash on the screen. I received a fatal error: exception code=C0000005 @ 07/08/03 10:26:22 PM.

I viewed the error log and that was the error in it. No help.

Please, can anyone steer me towards an answer? I think if I can get pass this and see a ugly report display, I will have all the learning curve underway.
 
Yes, I dropped the crystal report viewer on the form. I had added 2 new properties ocrystal and oreport and 1 new method setup to this per the CryDev book.

Does this help, Mike?

 
The most common cause of a C5 error seems to be a corrupt resource file. Delete the Foxuser.* files and try again.

Craig Berntson
MCSD, Visual FoxPro MVP, Author, CrysDev: A Developer's Guide to Integrating Crystal Reports"
 
Will do tonight. I will delete the foxuser file.

Thank you,

Any other suggestions?
 
That's all I can think of for now. I'm heading off on vacation tomorrow and will not have internet access, so I'll leave further assistance to others until I return.

Craig Berntson
MCSD, Visual FoxPro MVP, Author, CrysDev: A Developer's Guide to Integrating Crystal Reports"
 
Have a great time on your vacation. Thank you for letting me know. I would have thought you had grown tired of my learning curve...

Thank you for your help.

Your book has been my mental strength.

 
Betty,

With Craig away, the only thing I can suggest is that you disable dual-interface support while the preview is running. To do so, add this line to the Load of your preview form:

SYS(2333,1)

and this to the Unload:

SYS(2333,0)

If that doesn't do the trick, I would suspect that the form itself is corrupted in some way. Maybe throw it away and start again?

Mike


Mike Lewis
Edinburgh, Scotland
 
I have really messed up my default form class. When I create a new form there are only 2 properties. How can I get the default class back. I feel sure it some options but I don't see it. However, under the tools options I do not have another template selected. This area is blank with no check mark.

Do you think I need to reinstall FoxPro to reset my default correctly?


Thanks guys.
 
Betty,

Is this the same issue as your crashing Crystal viewer? If not, it would be better if you started a new thread. Not all forum members will see the message otherwise.

When you do, perhaps you could give a little more information. Is the class still visible in your class library? How do you go about creating a form based on that class (do you use CREATE FORM or the project manager, or what)?

One thing I can tell you .. it is unlikely you will need to to re-install VFP. At least, not yet ...

Mike




Mike Lewis
Edinburgh, Scotland
 
It goes back to the corrupt form you suggested. I don't know if I am crashing because of the form or not. I do know that it crashes when it gets to the report name in the init of the form.

I tried to recreate the form last night using the create form at the command window. That is when I realized that the properties of the default form were missing.

I may need to open another incident except, somehow, I suspect they are connected??
 
Betty,

OK, perhaps you are right that they are connected. Let's continue here for the moment.

First, can you see the class (the form class that is causing the problems) in your class library? If so, open it in the class designer and see if it is still intact. If not, you will either have to delete it and create it again, or restore it from a backup, if you have one.

If the class looks OK but the instance of the form is still bad, check the command that you used to create the form. It should be CREATE FORM <formname> AS <class name> FROM <library name>. This is not affected by the template class name in Tools / Options.

If the class looks OK but the instance looks bad ... well, I don't know what to suggest.

Mike


Mike Lewis
Edinburgh, Scotland
 
Mike, I have always use the defa form class. Just use the command window.

Create form

save the form with the name after starting the form.

I don't have my own class lib that I use. I know that this is not the best procedure.

This is where I do not see the properties of the default form.

I hope this makes sense.

Thank you,
 
Betty,

Sorry, I am bit confused. When you say the &quot;default form class&quot;, you mean the built-in form class? OK, that's reasonable.

And when you say you can only see two properties, I think that must be because you have selected &quot;non-default properties only&quot;.

If I'm right, here's what to do:

- Open the form designer (any form) and go the properties window.

- Right click just above the tabs at the top of the window.

- Remove the tick mark which is next to &quot;Non Default Properties Only&quot;.

Let me know if it works.

Mike


Mike Lewis
Edinburgh, Scotland
 
Mike, my form properties were fixed with your suggestion. I gave you a star on that one. I would have reinstalled if not for your help.

I am still crashing, but I now know that it is when my crystal report should instantiate.

From the command window

do form crystalreport with &quot;c:\dirname\reportname.rpt&quot;

** init on the form
LPARAMETERS tcReportName
this.oleCRPreview.setup(tcReportName) && crashes here.

** the crystal preview is displayed in the background/behind the error. The error is that c00 error.

** the report seems to be fine in crystal. I can preview, print, etc.

** resize_code on form


WITH THIS
.TOP=0
.LEFT=0
IF .PARENT.BASECLASS=&quot;Page&quot;
* the viewer is on the page of a page frame
.HEIGHT = .PARENT.PARENT.PAGEHEIGHT
.WIDTH = .PARENT.PARENT.PAGEWIDTH
ELSE
* just use the height and width of the parent
.HEIGHT = .PARENT.HEIGHT
.WIDTH = .PARENT.WIDTH
ENDIF
ENDWITH

*** setup code on form

LPARAMETERS tcReport, toreport, toCrystal

WITH THIS
IF PARAMETERS()=1
* only the report name was passed
.oCrystal= CREATEOBJECT(&quot;CrystalRuntime.Application&quot;)
.oReport= .oCrystal.OpenReport(tcReport)
** if I eliminate the report, will stop here with no report name.
ELSE
*all the parameters were passed
.oCrystal=toCrystal
.oReport=toreport
ENDIF
* setup the viewer properties
.ReportSource= .oReport
.DisplayBorder=.F.
.DisplayBackgroundEdge= .T.
.enableProgressControl= .F.
.RESIZE()
.ViewReport()
ENDWITH


 
Betty,

I'm not sure where the Setup method comes from. Is that a standard method in the report viewer, or one that was added to a subclass? (I am at home at the moment, and don't have my CR documentation with me.)

For the next step, you might try the following. In the Init of the form:

LPARAMETERS tcReportName
loCrystal= CREATEOBJECT(&quot;CrystalRuntime.Application&quot;)
loReport= loCrystal.OpenReport(tcReportName)
this.oleCRPreview.ReportSource = loReport
this.oleCRPreview.ViewReport

Don't put anything else in the Init. This will eliminate everything except the minimum code for showing the report. With luck, that will help us home in on the problem.

As a separate issue, you might also try my earlier suggestion about executing SYS(2333,1) (if you haven't aready done so). You can do that in the command window, before you launch the form.

Mike
PS Thanks for the star.

Mike Lewis
Edinburgh, Scotland
 
Yes, I put in the sys(2333,1) in the load of the preview form.

I put in the statements that you suggested in the init of the form. commented all the other statements I had.

I received an error
OLDE IDispathc exception code ) from Crystal Reports ActiveX Designer: File not found...

I went back and hardcoded in the the path and file name in the tcreportname. Same error. I know that file exists. The file name is cr_svds.rpt. When I develped the report in crystal, I have the don't save the data with the report checked. The table for the data is an xbase. copy to filename fox2x.

Could this be my problem?

Betty
 
Betty,

I doubt if that's the problem, but it would be worth trying to save the data with the report. I know that's not what you want, but at least it will eliminate that possibility.

Mike


Mike Lewis
Edinburgh, Scotland
 
I will do that tonight. The error comes from the
loReport= loCrystal.OpenReport(tcReportName) line of code.

I just know it is something that this learning curve will fix.

Thank you for hanging in here.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top