|
-
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.
-
Jun 8th, 2005, 08:21 AM
#2
Thread Starter
New Member
Re: Print Crystal Report from VB6 .dll, doesn't print!
Can anyone give me some advice?
-
Jun 8th, 2005, 08:30 AM
#3
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?
-
Jun 8th, 2005, 08:43 AM
#4
Thread Starter
New Member
Re: A shot in the dark...
 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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|