Results 1 to 6 of 6

Thread: Crystal Reports

  1. #1

    Thread Starter
    Lively Member chongo 2002's Avatar
    Join Date
    Apr 2000
    Posts
    106
    My report just stopped showing up in it's window here is my code.
    private sub cmdreport_click()
    Report.DataFiles(0) = App.Path & "\report.mdb"
    Report.PrintReport

    end sub()
    No errors reported either.

  2. #2
    Frenzied Member Buzby's Avatar
    Join Date
    Jan 1999
    Location
    UK
    Posts
    1,670
    Crystal does return errors but they're not always visible. Try this;

    Code:
    Dim Reply As Integer
    
    Report.DataFiles(0) = App.Path & "\report.mdb" 
    Reply=Report.PrintReport 
    
    If Reply<>0 Then
       Msgbox "Crystal Error " & Report.LastErrorNumber & " (" & Report.LastErrorString & ")"
    End If
    Do you get an error now..?



    'Buzby'
    Visual Basic Developer
    "I'm moving to Theory. Everything works there."

  3. #3
    Addicted Member
    Join Date
    Aug 2000
    Location
    Fremont Ohio 43420
    Posts
    253
    Hi chongo 2002,

    I have this in my code to show my Crystal Reports.

    Private Sub mnuReportsfrmPreviewShift_Click()
    With CrystalReport9
    .Destination = crptToWindow
    .DataFiles(0) = "H:\Software Development Projects\Maintenance database\Maintenance Data.mdb"
    .ReportFileName = "H:\Software Development Projects\Maintenance database\Summary By Shift.rpt"
    .Action = 1
    End With
    End Sub

    I also put the crystal report control on the main form, so that it would not trouble with showing the report. You can get that control from Project, Components, then select the crystal report control and apply.

    Good luck!

    jeffro

  4. #4

    Thread Starter
    Lively Member chongo 2002's Avatar
    Join Date
    Apr 2000
    Posts
    106
    I get an unable to open database error now or a report not found.

  5. #5
    Addicted Member
    Join Date
    Aug 2000
    Location
    Fremont Ohio 43420
    Posts
    253
    Let me see your code again.

    jeffro

  6. #6

    Thread Starter
    Lively Member chongo 2002's Avatar
    Join Date
    Apr 2000
    Posts
    106

    Thumbs up got it

    If i leave out the .datafiles line it works fine.

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