Link to home
Start Free TrialLog in
Avatar of yongyih
yongyihFlag for Malaysia

asked on

Problem related to VB and Crystal Report.

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??

Avatar of Mike McCracken
Mike McCracken

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
Avatar of yongyih

ASKER

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..

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
Avatar of yongyih

ASKER

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.
Rename it but through the CR file - SAVE AS

mlmcc
Avatar of yongyih

ASKER

no every report has problem except my friend's report.
rename didn't solve the error.
any coding will cause this problem?
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
Avatar of yongyih

ASKER

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..
Avatar of yongyih

ASKER

still waiting for more commend to solve this problem...
Avatar of yongyih

ASKER

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.
What code is he using for the report?

Does the report include any special functions?

mlmcc
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
Avatar of yongyih

ASKER

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?
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
Avatar of yongyih

ASKER

ok, i will ask him..  
Avatar of yongyih

ASKER

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. ^_^
Avatar of yongyih

ASKER

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?

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
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
Avatar of yongyih

ASKER

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.
Seems I suggested that as a problem or potential problem about a month ago.

mlmcc
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
ASKER CERTIFIED SOLUTION
Avatar of Computer101
Computer101
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial