|
-
Oct 5th, 2000, 08:36 PM
#1
Thread Starter
Lively Member
I have created a simple report using Crystal Report 32 that come with my vb6.
I then add a crystal report component and a command button into my form. In my command button click event i put in this code:
private sub command1_click()
crystalreport1.ReportFileName = app.path "\test.rpt"
crystalreport1.DiscardSaveData = True
crystalreport1.PrintReport
end sub
when I click on the command1 button nothing appear! I have a printer configured for the crystall report.
there is also no report of error during compilation or executing this code.
Where is my error????
-
Oct 5th, 2000, 10:02 PM
#2
Thread Starter
Lively Member
My program is working now. don't know why maybe my careless typo error.
anyway thanks for your help
regards
-
Oct 5th, 2000, 10:46 PM
#3
Thread Starter
Lively Member
Do you believe the same commands work on my laptop and desktop using win98 os but it refuse to work on my NT station???
Regards
-
Oct 6th, 2000, 10:14 AM
#4
Frenzied Member
Crystal doesn't always display errors when it fails - try this;
Code:
Private Sub Command1_Click()
Dim RepResult as Integer
With CrystalReport1
.ReportFileName=App.Path+"\Test.RPT"
.DiscardSavedData=True
RepResult = .PrintReport
If RepResult <> 0 Then
MsgBox "CRYSTAL ERROR: (" + CStr(.LastErrorNumber) + ") " + .LastErrorString, vbExclamation, "Can't Continue"
End If
End With
End Sub
That way, if there is an error you will get a message about it - do you?
'Buzby'
Visual Basic Developer
"I'm moving to Theory. Everything works there."
-
Oct 6th, 2000, 10:44 AM
#5
Thread Starter
Lively Member
Originally posted by Buzby
Crystal doesn't always display errors when it fails - try this;
Code:
Private Sub Command1_Click()
Dim RepResult as Integer
With CrystalReport1
.ReportFileName=App.Path+"\Test.RPT"
.DiscardSavedData=True
RepResult = .PrintReport
If RepResult <> 0 Then
MsgBox "CRYSTAL ERROR: (" + CStr(.LastErrorNumber) + ") " + .LastErrorString, vbExclamation, "Can't Continue"
End If
End With
End Sub
That way, if there is an error you will get a message about it - do you?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|