Bartender Prints When I Select "test Print" But Not When I Select Print S’abonner

0
Avatar
Legacy Poster

I'm controlling Bartender using COM, from inside another software package with an IDE.  When I call the automation to print (and set the dialog/etc to show up) the bartender window opens, with all of the proper selction critera (Printing from a SQL database) selected.  If I push "Print" the process hangs for about 20 seconds, then exits and nothing is sent.  IF I press "test Print" from the same dialog, the label is sent (actually prints out on the Zebra printer) and control returns in a second or so. 

 

What am I doing wrong? here is the code I'm using:

 

 IF ISCLEAR(btCom) THEN
   CREATE(btCom,FALSE,TRUE);

 IF ISCLEAR(btFormat) THEN
  CREATE(btFormat,FALSE,TRUE);
  btFormat := btCom.Formats.Open(GetFormatPath(l_LabelREC.FormatType),FALSE,''); //Open Label format

IF RangeString <> '' THEN
btFormat.RecordRange(RangeString);  //Tell it based on primary key what to print.
btFormat.JobName := USERID + ' Job' + FORMAT(TODAY);  // Make a job name and set it

IF GUIALLOWED THEN
 ResultVal := btFormat.PrintOut(FALSE,TRUE)     //Print Dialog,Print Status   <--this is the one I'm executing now
ELSE
 ResultVal := btFormat.PrintOut(FALSE,FALSE);  //No interface for Mobile users

MESSAGE('Printing Job: %2 to: %1',btFormat.Printer,btFormat.JobName);

 

....

 

Do some other stuff and close it.

 

Also ResultVal returns 0 in both cases.

6 commentaires

0
Avatar
Domingo Rodriguez
Modérateur
Actions pour les commentaires Permalien

Hello, a few questions:

1. What exact Edition, Version and Build of BarTender is in use?

2. Are you using a Seagull driver for your Zebra printer? If yes, what version?

3. How is the Zebra printer connected to the PC where your ActiveX application runs, is it locally connected (LPT, COM, USB), directly connected to the internal IP address of the printer... ?

4. From the code, I'm not sure if this is C#.Net or VB.NET. Please clarify.

5. Using COM Automation is obsolete. Why are you not making use of our .NET SDKs instead?

6. Have you tried using the Print() method instead of PrintOut() ?
0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

Hello, a few questions:

1. What exact Edition, Version and Build of BarTender is in use?

2. Are you using a Seagull driver for your Zebra printer? If yes, what version?

3. How is the Zebra printer connected to the PC where your ActiveX application runs, is it locally connected (LPT, COM, USB), directly connected to the internal IP address of the printer... ?

4. From the code, I'm not sure if this is C#.Net or VB.NET. Please clarify.

5. Using COM Automation is obsolete. Why are you not making use of our .NET SDKs instead?

6. Have you tried using the Print() method instead of PrintOut() ?

 

Thank you for responding.

 

 

1) Edition: Enterprise Automation (3 Printers)

    Version: 10.1 SR2

    Build: 2945

  

2) Yes

 

Printer:    Zebra Z4M (203 dpi)
Port:    192.168.1.188

Product:    Zebra ZPL-II Driver
Version:    7.3.4

Build Target:    x64
Build Date:    11/13/2013, 12:23 PM
 

3) IP

 

4) None of the above, the software has an integraded development environment, which is eventually translated into C#->CLR.

 

5) Your .NET SDK is built on an outdated Dotnet framework of Ver 2, my app doesnt like that we dont have access to the actual assemby code so I cant rebuild them without creating a wrapper, I'd prefer not to do that. Also if I used that I would much prefer to run it server-side but after several test (.net wrappers) it doesnt appear that it wants to run under a service

 

6) For some reason it gets upset with the messages parameter (object, yes its the right one messges vs message that I'm passing) that is passed to it, I was hoping to see if it returned some sort of error.  Is there some other place I can check what is getting returned(log or something that bartender keeps, I dont see anything interesting in the windows app log)?

 

 

The confusing part is why on earth does it work with "test print" and not "print"? What is the difference between the 2?  Is there anything else I should be specifiying in the format or the app object?

0
Avatar
Domingo Rodriguez
Modérateur
Actions pour les commentaires Permalien

The "Test Print" button will print the first label of your print job. If you send a print job with one label to be printed, the "Print" button will give you the exact same printer code than if you would use "Test Print"...

 

Yes, you can enable logging in BarTender via the "Administer > Log Setup > Text File Log" dialog.

 

Sorry, but I'm not sure if you've tested yet or not to use Print() rather than PrintOut(). Please confirm and let me know what problems you're having when using Print()

0
Avatar
Legacy Poster
Actions pour les commentaires Permalien


The "Test Print" button will print the first label of your print job. If you send a print job with one label to be printed, the "Print" button will give you the exact same printer code than if you would use "Test Print"...

 

Yes, you can enable logging in BarTender via the "Administer > Log Setup > Text File Log" dialog.

 

Sorry, but I'm not sure if you've tested yet or not to use Print() rather than PrintOut(). Please confirm and let me know what problems you're having when using Print()

 

When I try .print I get a type mismatch which I assume has something to do with the messages object, not sure why.

 

 

bt_Format.Print('TESTJOB',FALSE,-1,bt_Messages)

 

and

 

bt_Messages = 'BarTender 10.1'.Messages

 

I realize this is an overloaded method however when I try to use the simplest one with only a printjob name even though the complier has no problem with it at runtime I get a parameter is not optional error.

 

 

 

 

OK with logging on now I'm getting somewhere:

 

 

 

2014-03-27    11:50:48    1200    Information    Database    OK    SQL Statement:  SELECT "timestamp", "Entry No_", "UserID", "ShipName", "OrderNum", "ShipMethod", "ShipAddr", "ShipPhone", "ShipCity", "ShipState", "ShipPost", "NoLables", "ItemNo", "Description", "BarCode", "ShipCitystateZip", "NoOf", "FormatType" FROM "dbo"."BarTender Label"

 

2014-03-27    11:51:19    3239    Error    Database    OK    OLE DB has encountered error 0x80040E31:    Unknown error.    OLE DB error message:    IDispatch error #3121


 

 

It definitely looks like its having trouble with retrieving the records.  The label should read records out of a SQL database table in order to get the information to print on the label.   I thought that information for the database connection should be stored in the label definition and it appears to work fine when I was designing the label(the .btw file).  How does it know at runtime how to connect to SQL? Is there some way to specify the connection info when I call the COM object(Ie perhaps setting up a DSN on the machine and passing it somehow)?

0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

This is defintely a connection issue. 

 

 

--edit--

 

Got it, SQL permissions issue. thanks for the help

0
Avatar
Domingo Rodriguez
Modérateur
Actions pour les commentaires Permalien

Good to know that problem is solved. Thanks for the update

Vous devez vous connecter pour laisser un commentaire.