Results 1 to 4 of 4

Thread: Print Crystal Report from VB6 .dll, doesn't print!

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2002
    Location
    Toronto, Ontario
    Posts
    12

    Print Crystal Report from VB6 .dll, doesn't print!

    Hey folks

    I've developed an application that basically monitors a folder, pulls any files from the folder, does some work with the database from the file and prints out a report from a VB6 dll. The application works fine on my development machine, but when I deploy to the client, NO errors appear but nothing prints and nothing goes into the print queue.

    My project is:

    VB6 dll which prints out the crystal report.
    .NET service which references the VB6 dll

    Everything works perfectly on my development machine, but when it's on the client, nothing gets put on the queue when printing.

    I've debugged the application with even logging statements and it goes right to the print function all the way to the end with no errors. I believe all the appropriate Crystal merge modules (craxdrt.dll and p2sodbc.dll) are on the client machine, but it just doesn't want to print. Any help would be appreciated. I've posted my print method below with my logging statements.


    VB Code:
    1. Private Sub Waybill_Print(ByVal lOrderNo As Long)
    2.     On Error GoTo Errhandle
    3.     Dim objApp As CRAXDRT.Application
    4.     Dim objRep As CRAXDRT.Report
    5.     Dim lngCounter As Long
    6.    
    7.     App.LogEvent "print 1"
    8.    
    9.     Set objApp = New CRAXDRT.Application
    10.    
    11.     App.LogEvent App.Path & "\OrdersWaybill_PakEx.rpt"
    12.    
    13.     Set objRep = objApp.OpenReport(App.Path & "\OrdersWaybill_PakEx.rpt")
    14.    
    15.     App.LogEvent "print 2"
    16.    
    17.     objRep.Database.LogOnServer "p2sodbc.dll", "CourierReports3", "dbname", "dbname", "blahblah"
    18.    
    19.     For lngCounter = 1 To objRep.Database.Tables.Count
    20.         With objRep.Database.Tables(lngCounter)
    21.             .SetLogOnInfo "CourierReports3", "dbname", "dbname", "blahblah"
    22.             .Location = "couriercomplete" & Mid$(.Location, InStr(1, .Location, ".dbo"), Len(.Location))
    23.             App.LogEvent "location is: " & "dbname" & Mid$(.Location, InStr(1, .Location, ".dbo"), Len(.Location))
    24.         End With
    25.     Next lngCounter
    26.    
    27.     With objRep
    28.         .DiscardSavedData
    29.         .ParameterFields(1).AddCurrentValue lOrderNo
    30.         .PrintOut False, 3
    31.     End With
    32.     App.LogEvent "print end"
    33.        
    34. FuncExit:
    35.     If Not (objApp Is Nothing) Then Set objApp = Nothing
    36.     If Not (objRep Is Nothing) Then Set objRep = Nothing
    37.     Exit Sub
    38. Errhandle:
    39.     App.LogEvent "in error " & Err.Description
    40.     Err.Raise Err.Number, mcstrCLASSNAME & ".Waybill_Print()", Err.Description
    41.     Resume FuncExit
    42. End Sub
    Last edited by hshot_rooke; Jun 8th, 2005 at 08:33 AM.

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