Labelformatdocument.print Freezing On Bt10 Sdk Any Thoughts? 追蹤

0
Avatar
Legacy Poster

'get a new bartender engine instantiated
engine = New Engine(True)

'check global format has been cleared and clear if still in use.
If format IsNot Nothing Then
    format.Close(SaveOptions.DoNotSaveChanges)
End If

'instantiate new label formats
Dim btStartFormat As LabelFormatDocument

'load the label formats into memory.
btStartFormat = engine.Documents.Open(WaveOrderStart.LabelDirectory & WaveOrderStart.LabelFormatName, PrinterName)

'getdatabase connections for all formats
Dim btDB1 As New Seagull.BarTender.Print.Database.OLEDB(WaveOrderStart.Database)
btDB1.UserID = WaveOrderStart.DBUsername
btDB1.SetPassword(WaveOrderStart.DBPassword)

'apply database connections to label formats
If btStartFormat.DatabaseConnections.Count > 0 Then
    btStartFormat.DatabaseConnections.SetDatabaseConnection(btDB1)
End If

Dim messages As Messages
Dim messageString As String
Dim result As Result

messages = Nothing
result = btStartFormat.Print(strApp, waitForCompletionTimeout, messages)
messageString = Constants.vbLf + Constants.vbLf & "Messages:"

For Each message As Seagull.BarTender.Print.Message In messages
    messageString &= Constants.vbLf + Constants.vbLf + message.Text
Next message

If result = result.Failure Then
    Throw New Exception("An error has occured when printing a label - " & messageString)
End If
 

my code above is pulled primarily from th sdk print examples, however during testing the code is not failing but seems to be entering an un-ending process of some description.

 

On the line:

 

result = btStartFormat.Print(strApp, waitForCompletionTimeout, messages)

the code just stops, no exceptions thrown or any responses at all from the managed code.

 

Please can someone tell me if im being immensely dumb or just blind?

 

Cheers :)

3 意見

0
Avatar
Fernando Ramos Miracle
版主
評論操作 永久連結

Hello Scott,

 

Could you try modifying your code so it doesn't wait for a status response before printing (basically remove the waitForCompletionTimeout variable)? Waiting for a status response might be what's causing your application to get stuck.

 

In any case, could you let me know what value does the waitForCompletionTimeout variable usually take?

 

Also please make sure that you are working with the latest release for your BarTender version, you'll found it in the below webpage:

http://www.bartenderbarcodesoftware.com/label-software/service-releases.aspx

0
Avatar
Legacy Poster
評論操作 永久連結

Hi Fernando,

 

thanks for your reply and apologies for my delayed response. the issue with the freezing was it could not locate the seagull server due to the port being different. i was abit unsure as to why the print call did not fail with a cannot locate server error though.

 

any ideas?

 

Cheers,

Scott

0
Avatar
Fernando Ramos Miracle
版主
評論操作 永久連結

An activated BarTender that has been able to locate the SLS will still print during 72 hours even if this connection fails. Could it be that BarTender was still running on this 72 hours grace period?

 

Another possibility is that you were working with a non activated BarTender that still had trial days remaining.

 

If BarTender was not able to locate the SLS the above are they only two options that will allow it to print.

登入寫評論。