开发者

Crystal Reports talking to a Com Port

We're using Cryst开发者_运维技巧al to create receipts using a USB port connector to our printer. We'd now like Crystal to 'ping' the serial port to open a cash draw. Is there any way of getting Crystal to do that?


If you are printing your receipt to a USB port you will not be able to ping the COM port to open the drawer from Crystal.

Something you can try is to create a windows Generic Text Printer connected the the COM port. Then go to the properties and select the Printer Commands Tab and enter the code to open the drawer in the Begin Print Job. That will send the code every time you send a job to that printer. Then send an empty report to that new printer right after the receipt. That trick has worked for me.

The code that you have to use depends on the drawer / printer brand. Check this site


That depends on the connection, the type of printer used and the cash drawer. Since you did not supply what language can crystal interact with (activex, dll)? I will edit this answer again once more information is supplied.

Edit: Ok, it might be worth it to use a serial activex such as MSComm.ocx, and write to the serial port via the MSComm.ocx. The appropriate code to eject the cash drawer is dependant on the hardware. (Can you provide more information on this please?) Also I need to know how is the crystal report generated - is there a third party source code that you have access to that generates the report (Again, a sample code highlighting where the report gets generated please? as for example below in pseudocode)

load crystal report
print it
; Here is where you need to emit a code to send to serial port to open cash drawer

Hope this helps, Best regards, Tom.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜