Results 1 to 5 of 5

Thread: Crytal Report - Unable to display my report

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Malaysia
    Posts
    90

    Question

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

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Malaysia
    Posts
    90
    My program is working now. don't know why maybe my careless typo error.

    anyway thanks for your help

    regards
    CT

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Malaysia
    Posts
    90
    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
    CT

  4. #4
    Frenzied Member Buzby's Avatar
    Join Date
    Jan 1999
    Location
    UK
    Posts
    1,670
    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."

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Malaysia
    Posts
    90
    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?

    CT

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width