Anyone has experience with printing magnetic bands on Zebra printers?
A user of my end user reporting application uses reportbuider to print on a Zebra XPS series 7.
Report Builder is basically used to print the graphical part (one one side the picture of the employee, the name and some info, on the other side a "if foudn please return to ....") when printing from the preview form he opens printer settings and then goes into the page where he can type(paste in f act) the badge number that he would like to print on the card. Ideally i would like to pass that number from the report to the printer but this seems odd unless i do a custom RB function that uses the dll provided by zebra. Somehow i could register a function in RAP called EncodeMagneticBand(aTextToEncode: string) this could work.
But before starting this exploration I'd like to ask if anyone already used Report Builder to print on a Zebra XPS series 7 or similar printer.
Thanks.
Report Builder is basically used to print the graphical part (one one side the picture of the employee, the name and some info, on the other side a "if foudn please return to ....") when printing from the preview form he opens printer settings and then goes into the page where he can type(paste in f act) the badge number that he would like to print on the card. Ideally i would like to pass that number from the report to the printer but this seems odd unless i do a custom RB function that uses the dll provided by zebra. Somehow i could register a function in RAP called EncodeMagneticBand(aTextToEncode: string) this could work.
But before starting this exploration I'd like to ask if anyone already used Report Builder to print on a Zebra XPS series 7 or similar printer.
Thanks.
Comments
We've definitely had customers use RB to generate id cards, but we're not aware whether anyone has implemented a Zebra XPS solution for generating magnetic codes.
I Googled and found this ZMotif SDK+ Delphi example. That would be a good starting point. Test with Delphi code and then as a second step build a RAP pass-thru function.
https://km.zebra.com/kb/index?page=content&id=SA232&actp=LIST
Zebra also has a printer control language called ZPL, might be another option. To send control codes to the printer implement the Report.OnPrinterDeviceStateChange event and to call the Report.Printer.SendEscape method.
Here's an example from the RB Help topic for Report.OnPrinterDeviceStateChange Once you implement a solution, perhaps you would like to share by posting a followup here.
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
When you say that SendEscape can be used tosend commands using zebra language you mean that in out code if i replace 'some escape code here' with '^FO50,200^A0N,40,30^BCN,150,Y,N,Y^FD>;>80012345123451234512^FS'
?
I just copied and pasted a random ZPL statement foudn by googling.
if this is true i could avoid binding to zebra dlls but simply use SendEscape i could communicate to the printer.
Is this what you told me?
Thanks.
I copy and paste from the printer documentation:
With ZXP Series 7Card Printers, we provide support for pass-through magnetic
encoding commands.
The application developer or user can use a preamble or Macro to indicate to the driver that the
data following the Preamble or Macro is to be mag encoded.
The user can have encoding and printing data on the same card, and the driver will filter out
the encoding data from the printing data. The user does not have to know job control syntax or
ZMotif commands to send mag encoding commands to the printer.
Supported Macro commands are: somehow with SendEscape I imagine i should send those commands?
Customer currentl prints from report builder and in print dialog he opens the printer options and manually fills Track1/2/3 Data fields by pasting a number that is something like '000000000000012324', same value in all 3 tracks.
So my first instinct is to do something like:
I hope i expressed my self. THere could be big issues in what I wrote since it is the first timei tackle this kind of tasks. Moreover since it is problematic for me to test (i need to send an exe that the customer can try i cannot connect with my pc and really study what goes on) I'd like to make a small sample that just sends these escapes.
Could you please guide me a little bit more?
Thanks a lot.
I recommend purchasing the printer or have the client send it to you. You need the printer for testing. Its up to the printer manufacturer how they implement the functionality.
The example code you have there looks ok to me, though from the docs I'm not sure whether the angle brackets need to be included - you can try it both ways. Try downloading the printer driver and installing it on your machine. And then in your code, add calls to QueryEscape like this RB has Printer.QueryEscape and Printer.SendEscape methods - which call the Windows API Escape function passing a flag of either QUERYESCSUPPORT or PASSTHROUGH. The QUERYESCSUPPORT will ask the printer to verify whether it supports the specified command and return a boolean result.
https://msdn.microsoft.com/en-us/library/windows/desktop/dd162701(v=vs.85).aspx
I also don't know the difference between Zebra 'macros' and ZPL. It might be that you can assign a macro command to the Label.Caption property of a label placed on the report layout and then the printer will detect it. Long shot, but simple enough to give it a try.
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com