Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

please help! - method 'Action' of 'CrystalCtrl' failed

Status
Not open for further replies.

JHerr

Programmer
May 25, 2001
42
US
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

 
Another thing to mention is that when i ran the vb app on the pc that i developed the report on it worked fine. The same printers are set up on the other pc's, and they're going off the same sql server. the on;y difference is that the pc i use to develop is winME and the app is run on win2k server. just thought i'd mention that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top