|
-
Jun 7th, 2005, 12:26 PM
#1
Thread Starter
New Member
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:
Private Sub Waybill_Print(ByVal lOrderNo As Long)
On Error GoTo Errhandle
Dim objApp As CRAXDRT.Application
Dim objRep As CRAXDRT.Report
Dim lngCounter As Long
App.LogEvent "print 1"
Set objApp = New CRAXDRT.Application
App.LogEvent App.Path & "\OrdersWaybill_PakEx.rpt"
Set objRep = objApp.OpenReport(App.Path & "\OrdersWaybill_PakEx.rpt")
App.LogEvent "print 2"
objRep.Database.LogOnServer "p2sodbc.dll", "CourierReports3", "dbname", "dbname", "blahblah"
For lngCounter = 1 To objRep.Database.Tables.Count
With objRep.Database.Tables(lngCounter)
.SetLogOnInfo "CourierReports3", "dbname", "dbname", "blahblah"
.Location = "couriercomplete" & Mid$(.Location, InStr(1, .Location, ".dbo"), Len(.Location))
App.LogEvent "location is: " & "dbname" & Mid$(.Location, InStr(1, .Location, ".dbo"), Len(.Location))
End With
Next lngCounter
With objRep
.DiscardSavedData
.ParameterFields(1).AddCurrentValue lOrderNo
.PrintOut False, 3
End With
App.LogEvent "print end"
FuncExit:
If Not (objApp Is Nothing) Then Set objApp = Nothing
If Not (objRep Is Nothing) Then Set objRep = Nothing
Exit Sub
Errhandle:
App.LogEvent "in error " & Err.Description
Err.Raise Err.Number, mcstrCLASSNAME & ".Waybill_Print()", Err.Description
Resume FuncExit
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|