Solved

Problem related to VB and Crystal Report.

Posted on 2002-07-17
23
184 Views
Last Modified: 2010-05-02
I have a project that has a lot of forms and report (crystal report).  When compile the program, everything is fine and all reports are no error.

After make exe for this project and close VB, VB request to save the .dsr file.  Either save it or not, a "perform illegal operation" message display on screen.

When i use that exe file to run my program, the program can run, but when i want to view the report the program hang and an error message display on screen. "MyProject caused an invalid page fault in module CRAXDRT.DLL at 0167:4leb2324.

"MyProject" is my project name.

Can anyone tell me why this happen and how to solve this problem??

0
Comment
Question by:yongyih
23 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 7159485
The reports aren't being saved as .dsr files.

The runtime error is because the file doesn't exist or is corrupt in some way.

Recommend you uninstall CR and reinstall from scratch.  I suspect one of the CR dlls has been corrupted.  

If that doesn't work let me know.

good luck
mlmcc
0
 
LVL 2

Author Comment

by:yongyih
ID: 7159579
actually i am helping my friend to ask about this..
my friend said only one of the report has problem.
when view that report, error will occur.  other report should be no problem.

besides, the error happend in every pc in office..

any idea why this happen?

Anyway, i will ask my friend try to reinstall CR..
if still have problem, i will let u know.

thanks for reply..

0
 
LVL 100

Expert Comment

by:mlmcc
ID: 7160301
I had similar problems with one of my reports.
I ended up rebuilding the report from CR and then importing it to VB.  You may be able to open the report and save it to another file.

good luck
mlmcc
0
 
LVL 2

Author Comment

by:yongyih
ID: 7160967
my friend said he rebuild the report for 3 times already but i not sure he build it in VB CR designer or in CR.

Save that report to another file, you mean rename it?  this is another solution, i will ask my friend to tell this later on.

if have any other new solutions, please tell me.
thanks.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 7161231
Rename it but through the CR file - SAVE AS

mlmcc
0
 
LVL 2

Author Comment

by:yongyih
ID: 7162036
no every report has problem except my friend's report.
rename didn't solve the error.
any coding will cause this problem?
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 7163923
Can't think of any coding that would cause the problem.  What code is he using to display the report?  

I avoid using the .dsr method because if the report changes I have to recompile and redistribute the applicationi whereas using either the ActiveX viewer or the CR viewer & the RDC I can open any report through code and when the report changes I simply swap out the report files.

I'll try to post my code in the morning.

mlmcc
0
 
LVL 2

Author Comment

by:yongyih
ID: 7165082
He design his report in crystal report and add into VB..
we really no idea why this happen...
save as doesn't solve this problem too..
0
 
LVL 2

Author Comment

by:yongyih
ID: 7166838
still waiting for more commend to solve this problem...
0
 
LVL 2

Author Comment

by:yongyih
ID: 7169062
My friend said if he disabled most part of the coding, then he can compile the project.  If put back everything, then compile error again.  He tried to save as and rename.  At first, can compile the project become exe file. (Remark most part of coding)  After remove all remarks, VB cannot compile the project anymore.  He restart pc for few times but still cannot compile successfully.  When compile half way, an error message 'perform illegal function in kernel.dll file..' display on screen.

Why this happen????  Please reply me. Thanks.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 7169438
What code is he using for the report?

Does the report include any special functions?

mlmcc
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 100

Expert Comment

by:mlmcc
ID: 7169458
Here is the code I use.  Note the report is just the .rpt file, it isn't included in the VB.  This code is on the CRViewer form.

Dim crApp As CRAXDRT.Application
Dim crRpt As CRAXDRT.Report

'
'   Check if report is already in use
'
    If IsObject(crRpt) Then
       Set crRpt = Nothing
    End If

'
'   Open report
'
    Set crApp = New CRAXDRT.Application

    Set crRpt = crApp.OpenReport("c:\CR\Reports\myrpt.rpt", 1)

'
'   Set flags for CRViewer
'
    crRpt.MorePrintEngineErrorMessages = False
    crRpt.EnableParameterPrompting = False
    crRpt.DiscardSavedData


'
' Set the viewer's report source to the Report object
'
    Me.rptCRViewer.ReportSource = crRpt      
    Me.rptCRViewer.ViewReport
    Me.Show

good luck
mlmcc
0
 
LVL 2

Author Comment

by:yongyih
ID: 7171020
My friend create every crystal report in VB. (.DSR)  He have to do like this because the program allow user to do report customization.  Therefore, the way he load the report is the same as yours.

No special function in his report.

He redo all reports for few times already but still the same.

Do you think any function will cause this error and why the kernel.dll error occur?
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 7171814
Is he referencing the Crystal Runtime or Design Time library.  Since he wants the users to customize the reports he needs to include the RunTime library.

mlmcc
0
 
LVL 2

Author Comment

by:yongyih
ID: 7173132
ok, i will ask him..  
0
 
LVL 2

Author Comment

by:yongyih
ID: 7176862
According to my friend, he do everything within VB (add crystal report).  as for the customization, he do it through coding in VB program. (set different font, font size..)

If a crystal report contain too many formular, it will cause errors or not? (The program contains a lot of forms and reports and need qite a long time to compile..)

He need to solve this problem within these few days..

If you have any friends that good in VB or crystal report, please help me to ask them, thanks first. ^_^
0
 
LVL 2

Author Comment

by:yongyih
ID: 7184379
My friend still cannot solve this problem..
according to what he said, in that project, they used both Crystal Report version 7 and 8.. Is it ok?

0
 
LVL 100

Expert Comment

by:mlmcc
ID: 7195238
That is most likely the problem.  CR 7 & 8 file formats are different.  I would update all reports to one or the other and then try the project.

CR8 can save back to CR7 or it can import and save as CR8.

I had many problems trying to use the DSRs especially when the project got large and the number of reports grew.  By going to the .rpts we have been able to have larger projects with as many reports as necessary.

If you are trying to allow users to modify/develop their own reports you will need a CR license for each machine/user.

mlmcc
0
 

Expert Comment

by:mansonlam
ID: 7248654
I had the same problem for some reports with graphs. Did you include "pg32conv.dll" in your setup package? I found from Crystal Report's web site and know that the shared file is needed for producing graphs. Yet, if it does not work, you can try to include more shared files in "D:\program files\Seagate Software\Shared" in your package. I think quite a lot of dependency information for CR's files are incomplete and therefore PDW can not manage to include enough dependent files in the package.
Hope this work for you.
Manson
0
 
LVL 2

Author Comment

by:yongyih
ID: 7248878
I solved the problem already.  We separate the project into few different projects.  Then, no more compilation error and everything work correctly.

My problem is the system is too large.  

Hope this can help you too. Good Luck.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 7250382
Seems I suggested that as a problem or potential problem about a month ago.

mlmcc
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 8013789
Hi yongyih@avtech,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Refund points and save as a 0-pt PAQ.

yongyih@avtech, Please DO NOT accept this comment as an answer.
EXPERTS: Post a comment if you are certain that an expert deserves credit.  Explain why.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 8096147
Question placed in PAQ

Computer101
E-E Admin
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now