Provo a spiegarmi meglio ...
l'applicazione web registra delle vendite di prodotti
Obiettivo: gli utenti della logista, dopo aver preparato l'ordine, devono stampare lo scontrino fiscale della merce venduta.
E' stata acquistata una stampante fiscale, che non si comporta come tutte le stampanti, ma si può interagire con essa tramite pc. Sono sicura che fino ad adesso la procedura seguita è corretta, quindi l'installazione del OPOS.NET, come l'implementazione del OCX, tutto ciò mi è stato già confermato dai tecnici Epson.
Adesso il mio problema è durante la vera e propria fase di stampa.
Riporto il codice
Il programma si stoppa quando cerco di eseguire la stampa "m_Printer.PrintNormal(PrinterStation.Receipt, "Hello OPOS for .Net" + vbCrLf)" restituendomi questo errore:codice:Private Sub ButtonStampa_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ButtonStampa.Click InizializzaStampante() Stampa() ChiudiStampante() End Sub Public Sub InizializzaStampante() '<<<step1>>>--Start 'Use a Logical Device Name which has been set on the SetupPOS. Dim strLogicalName As String Dim deviceInfo As DeviceInfo Dim posExplorer As PosExplorer strLogicalName = "PosPrinter" 'Create PosExplorer posExplorer = New PosExplorer m_Printer = Nothing Try deviceInfo = posExplorer.GetDevice(DeviceType.PosPrinter, strLogicalName) m_Printer = posExplorer.CreateInstance(deviceInfo) Catch ex As Exception Return End Try Try 'Open the device m_Printer.Open() 'Get the exclusive control right for the opened device. 'Then the device is disable from other application. m_Printer.Claim(1000) 'Enable the device. m_Printer.DeviceEnabled = True Catch ex As PosControlException m_Printer.Release() End Try End Sub Public Sub Stampa() Try 'As using the PrintNormal method, send strings to a printer, and print it '[vbCrLf] is the standard code for starting a new line. m_Printer.PrintNormal(PrinterStation.Receipt, "Hello OPOS for .Net" + vbCrLf) Catch ex As PosControlException End Try '<<<step2>>> End End Sub Public Sub ChiudiStampante() If m_Printer Is Nothing Then Return End If Try 'Cancel the device If m_Printer.DeviceEnabled Then m_Printer.DeviceEnabled = False End If 'Release the device exclusive control right. m_Printer.Release() Catch ex As Exception Finally 'Finish using the device. m_Printer.Close() End Try End Sub
helppppppp ....... nessuno ha dei suggerimenti???codice:================== Exception ===================== Microsoft.PointOfService.PosControlException ErrorCode : Failure (111) ErrorCodeExtended : 0 Message : It is not initialized. Target : System.String CheckHealth(Microsoft.PointOfService.HealthCheckLevel) ## StackTrace ## at jp.co.epson.upos.pntr.CommonPrinterService.CheckHealth(HealthCheckLevel level) at CheckHealthTest.MainForm.ExecuteCheckHealth(DeviceInfo objInfo) at CheckHealthTest.MainForm.btnCheckHealth_Click(Object sender, EventArgs e)


 
			
			 
			 
					
					
					
						 Rispondi quotando
  Rispondi quotando