Results 1 to 4 of 4

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

  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.

  2. #2

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

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

    Can anyone give me some advice?

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

    A shot in the dark...

    Have you verified that:

    All CR report files are indeed present and registered on the client machine?
    Is your .Dll registered properly with the OS on the client machine?

  4. #4

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

    Re: A shot in the dark...

    Quote Originally Posted by Hack
    Have you verified that:

    All CR report files are indeed present and registered on the client machine?
    Is your .Dll registered properly with the OS on the client machine?
    Yes, my CR report file (.rpt) (only 1) is present on the client machine.

    As for the CR runtime files, I have another application that runs in a similar way, but has a GUI interface that prints other reports fine on that machine.
    So, I believe all the Crystal runtime files are on the client and registered fine.

    Yes, my VB6 .dll is registered fine on the client because the all the other code in the .dll is running fine.

    The machine I was working on was Win2000 Pro and I've also tried on a WinXP Pro machine. Both times I was the Administrator and both times gave identical results in that all the messages were going to the event log both before and after the print method and no errors were recorded, BUT no items sent to the printer.

    Also, the WinXP Pro machine had Crystal Reports 8.5 installed on it as well.

    Any suggestions?

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