Results 1 to 7 of 7

Thread: [RESOLVED] VB6 Crystal Report Error 20515

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2006
    Posts
    90

    Resolved [RESOLVED] VB6 Crystal Report Error 20515

    I'm trying to run a crystal report from vb6 and I'm getting an error 20515 from the following code, any help will be appreciated.

    Code:
    Private Sub MnuPurficationRoutinemasterList_Click()
    
    On Error GoTo HandleError
        
        Dim ReportName As String
        Dim lcReturnValue As String
        Dim lcNetworkPath As String
        Dim lcEntityName As String
        Dim lrsPurficationRoutineMasterReportData As ADOR.Recordset
        Dim loReports As TrxObject.clsReports
        Set loReports = New TrxObject.clsReports
        
        lcNetworkPath = "C:\SourceSafe\Tracs\TRACS7.0\client\"
        'lcNetworkPath = GetNetworkPath
        
        Set lrsPurficationRoutineMasterReportData = loReports.GetPurficationRoutineMasterListRS
       
        Screen.MousePointer = vbHourglass
                                               
        If Dir(lcNetworkPath & "ReportsSQL\" & "PurficationRoutineMasterList.rpt") = "" Then
            MsgBox "Report Not Available.", vbCritical, "Report Error"
        Else
            CrystalReport1.ReportFileName = lcNetworkPath & "ReportsSQL\" & "PurficationRoutineMasterList.rpt"
            CrystalReport1.SetTablePrivateData 0, 3, lrsPurficationRoutineMasterReportData
            
            CrystalReport1.Destination = crptToWindow
            CrystalReport1.WindowTitle = "Tax Partners, L.L.C. - TRACS Reporting"
            CrystalReport1.WindowLeft = 0
            CrystalReport1.WindowWidth = 800
            CrystalReport1.WindowTop = 70
            CrystalReport1.WindowHeight = 500
            
            'If lrsTaxReturn.EOF = True Then
            '    lrsTaxReturn.AddNew
            '    lrsTaxReturn("Name") = goEntity.Name
            '    lrsTaxReturn.Update
            'End If
            
           
            lcReturnValue = CrystalReport1.PrintReport      '  Generate the report
            
            If Val(lcReturnValue) > 0 Then
               MsgBox "Error Number:  " & lcReturnValue & Chr(13) & " Report Not Created."
            End If
            ' The reset method clear Crystal from memory.  This
            ' allow the user to view one report, release the report and
            ' then view the next report quickly thereafter.
            ' Without the reset method the next report can not be viewed
            ' until 4 or 5 seconds later, because the previous crystal
            ' file was not being released from memory fast enough.
            CrystalReport1.Reset
        End If
        Screen.MousePointer = vbDefault
        Exit Sub
    
    HandleError:
       Dim liReturnValue As Integer
       liReturnValue = CentralErrorHandler(Err.Number, "MnuPurficationRoutinemasterList_Click", _
                       "frmMain", "TRACS.vbp")
       If liReturnValue = 0 Then
          Resume
       ElseIf liReturnValue = 1 Then
          Resume Next
       ElseIf liReturnValue = 2 Then
         Exit Sub
       End If
    
    End Sub

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: VB6 Crystal Report Error 20515

    What is the wording of the error message an on what line does it happen?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jan 2006
    Posts
    90

    Re: VB6 Crystal Report Error 20515

    It returns the string "20515" with the following:

    lcReturnValue = CrystalReport1.PrintReport ' Generate the report

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: VB6 Crystal Report Error 20515

    Oh, you have error trapping on.

    Comment out the On Error GoTo and let it give you a run time error. That will generate the actual text of the error message and when you click "Debug" it will take you to the line that caused it.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jan 2006
    Posts
    90

    Re: VB6 Crystal Report Error 20515

    I commented it out but it ran without error but the report didn't display.

  6. #6
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: VB6 Crystal Report Error 20515

    20515 means there is an error in one of the report formulas.

    PrintReport does not raise runtime errors. You would need to use the Action property, although you would probably just get Error # 20515, "Error in Formula".

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Jan 2006
    Posts
    90

    Re: VB6 Crystal Report Error 20515

    Thanks, I had an incorrect formula with one of my fields.

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