OK
i've developed a number of reports for in house use in CR 8.5. I have a VB app that handles the printing on demand. the last two reports i have made however have caused errors, and VB crashes, even in the IDE. after exploring the issue more i was able to uncover the error "method 'Action' of 'CrystalCtrl' failed." Again, this only happens when i try and print the last two reports i made, every other on works fine, and i use just about the same code to print them. the reports are made here in my office, then distributed to a server at one of our locations, and the vb app prints the report to the correct printer for that user. i personally feel it may have something to do with the printers, but i am not too sure.]here's an example of the code i'm using:
Public Sub PrintReceipt(ByVal Num As String)
Dim CRReceipt As Object
Set CRReceipt = CreateObject("Crystal.CrystalReport"
CRReceipt.Connect = "DSN=" & myServer & ";UID=sa;PWD=;DSQ=TEST"
CRReceipt.ReportFileName = "C:\Program Files\reports\receipt1.rpt"
CRReceipt.PrinterDriver = myLaser.Driver
CRReceipt.PrinterName = myLaser.Name
CRReceipt.PrinterPort = myLaser.Port
CRReceipt.ParameterFields(0) = "@Number;" & Num & ";True"
CRReceipt.Destination = crptToPrinter
CRReceipt.Action = 1
Set CRReceipt = Nothing
End Sub
the report name is the same on every server, and the printers are set here depending on who printed it.
the error occurs on the line
CRReceipt.Action = 1 ,
hence the error "method 'Action' of 'CrystalCtrl' failed". i've looked all around the net, but i can't seem to find a resolution to this error under these circumstances, where it ony happens on two reports. Any suggestions (please...)
thanks!
-jacobh
i've developed a number of reports for in house use in CR 8.5. I have a VB app that handles the printing on demand. the last two reports i have made however have caused errors, and VB crashes, even in the IDE. after exploring the issue more i was able to uncover the error "method 'Action' of 'CrystalCtrl' failed." Again, this only happens when i try and print the last two reports i made, every other on works fine, and i use just about the same code to print them. the reports are made here in my office, then distributed to a server at one of our locations, and the vb app prints the report to the correct printer for that user. i personally feel it may have something to do with the printers, but i am not too sure.]here's an example of the code i'm using:
Public Sub PrintReceipt(ByVal Num As String)
Dim CRReceipt As Object
Set CRReceipt = CreateObject("Crystal.CrystalReport"
CRReceipt.Connect = "DSN=" & myServer & ";UID=sa;PWD=;DSQ=TEST"
CRReceipt.ReportFileName = "C:\Program Files\reports\receipt1.rpt"
CRReceipt.PrinterDriver = myLaser.Driver
CRReceipt.PrinterName = myLaser.Name
CRReceipt.PrinterPort = myLaser.Port
CRReceipt.ParameterFields(0) = "@Number;" & Num & ";True"
CRReceipt.Destination = crptToPrinter
CRReceipt.Action = 1
Set CRReceipt = Nothing
End Sub
the report name is the same on every server, and the printers are set here depending on who printed it.
the error occurs on the line
CRReceipt.Action = 1 ,
hence the error "method 'Action' of 'CrystalCtrl' failed". i've looked all around the net, but i can't seem to find a resolution to this error under these circumstances, where it ony happens on two reports. Any suggestions (please...)
thanks!
-jacobh