如何在Crystal Reports中将控制字符发送到Windows打印机? [英] How do I send control characters to a Windows printer in Crystal Reports?

查看:323
本文介绍了如何在Crystal Reports中将控制字符发送到Windows打印机?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在尝试构建一个Crystal Report,将控制字符直接发送到打印机,而无需通过该打印机的(错误)Windows驱动程序。有没有人知道一个方法来做这个从水晶报告?

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?

我们尝试发送的特定控制字符是CHR(2)。但是,当我们把它放在一个水晶报表中,并打印到一个通用文本打印机时,它正在将字符转换为输出期。该字符在Crystal的预览中显示为一个框,因此我怀疑它是Windows驱动程序,而不是Crystal。这是问题。

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.

设备是Datamax打印机。我们有它的驱动程序,但是遇到各种问题 - 基础设施组比我更了解问题,我不觉得我有足够的信息来尝试和询问具体的问题。它是Crystal Reports,Citrix,我们特定于市场的ERP软件包的相互作用的一种组合,并且在运行报告时基于用户自动选择标签打印机以适当的标签尺寸。

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.

推荐答案

简短的答案是你不能。最终,这是由于像Crystal这样的应用程序只在GDI级别,并将此数据交给打印机驱动程序转换为PCL / PS等,并传递到打印机。

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?

如果有一个驱动程序可以工作,但不是特定的设备,你可以使用它。另一个选项,这是一个有点'hacky',是使用迷你驱动程序开发工具包,并建立自己的。我们这样做的客户,我们插入我们自己的代码为自定义大小的纸张,在指定字母大小的工作周围的应用程序,不支持自定义大小的纸张或有一些特殊的字体,我们需要访问。此外,有一些打印机允许您将转义字符更改为别的东西,这取决于您的设备可能工作或构建一个后期过程,您打印到文件,文件被拾起,您修改打印文件通过寻找一些特殊的语法你输入和传递文件...痛苦,但可以做的伎俩。

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.

这篇关于如何在Crystal Reports中将控制字符发送到Windows打印机?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆