views:

1251

answers:

2

We are trying to build a Crystal Report that sends control characters directly to the printer, without going through the (buggy) Windows driver for that printer. Does anyone know a way to do this from within a Crystal Report?

The specific control character we are trying to send is CHR(2). However when we put that in a Crystal Report, and print to a Generic Text Only printer, it is converting the character to a period on output. The character appears as a box in Crystal's preview, so I suspect it is the Windows driver, rather than Crystal, that is the problem.

The device is a Datamax printer. We do have drivers for it, but are encountering various problems - the infrastructure group knows more about the problems than I do, I don't feel I have enough information to try and ask about the specific problem. It is some combination of the interplay of Crystal Reports, Citrix, our market-specific ERP package, and automatically selecting label printers for the appropriate label size based on user at the time the report is run.

A: 

Generally you cannot send escape characters directly to printer from Crystal Reports.

If you only need special character at the start or end of report (like paper cut or drawer open for POS printers), then you may use Generic Printer driver device options and describe Start or End Job sequence.

I personally have always found some working (or compatible) driver for any printer (what is your printer model, BTW?). For POS printers drivers often include specific "font", allowing send escape sequencies directly.

Arvo
A: 

Short answer is you can't. In the end it's a due to the fact that apps like Crystal only speak at the GDI level and hand this data to the printer driver to be converted to PCL/PS etc. and passed onto the printer.

What type of device is this? What are you trying to accomplish?

If there is a driver that works but isn't the specific one for the device you can use that. Another option, which is a little 'hacky', is to use the Mini Driver Development kit and build your own. We've done this for customers where we insert our own codes for things like a custom size of paper in where letter size is specified to work around apps that don't support a custom size of paper or have some special font we need to access. Also, there are some printers that allow you to change the escape character to something else, depending on your device that might work OR build a post process whereby you print to file, the file is picked up, you modify the print file by looking for some special syntax you entered and pass the file on...painful, but could do the trick.

Douglas Anderson
I don't believe post-processing is viable in our case. The reports are run by our ERP app, so we don't have anything other than the Crystal Report itself and Windows print server that is under our control.
LeBleu