Fastreports自定义预览问题
我在 FastReports 上遇到问题,它无法在包含韩语字符的页面上正确打印。仅在 HP K5300 jet 打印机上出现这种情况,使用 rave 对其进行了测试,没有问题。我认为这是快速报告的一个错误。我已经将所有报告从 rave 转换为 FastReports,并且没有计划移回。
我计划将生成的页面作为图像获取,而不将其保存到硬盘驱动器,然后生成新的预报告。这次,将使用并打印生成的图像。我知道这个解决方案不好。在等待他们的答复时,这是目前可行的。
有人知道如何从生成的页面获取图像吗?
I encounter problem on FastReports, it will not print correctly on pages which contain Korean character. It hapens only on Printer HP K5300 jet, T test it using rave and having no problem. I think it a bug for fast reports. I already convert all my reports from rave to FastReports and dont have plan to moved back.
I am planning to get the generated pages as images without saving it to hard drive and then generate a new preports. this time, the generated images will be used and print. I know this solution is not good. this is worable for now While waiting for their responds.
anybody has any idea how to get the images form generated pages?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您只是想避免保存大量文件,可以创建一个新的导出类,以便在文件创建后立即打印并立即将其删除。
您可以创建一个全新的导出类,从内存中打印位图(例如,使用 TPrinter 类并直接在打印机画布中绘制位图)...您将了解如何检查 TfrxBMPExport 类的源文件。
以这段未经测试的代码为例,它将指导您如何创建一个新类来保存/打印/删除:
在生产代码中,您将需要重写其他方法来初始化和完成打印机作业、清理等。
代码基于在 FastReport v4.0 上实现了 TfrxCustomImageExport,专门用于页码和文件命名。它可能需要针对其他 FastReport 版本进行调整。
If you just want to avoid saving a lot of files, you can create a new export class to print the file just after it is created and delete it instantly.
You can create a whole new export class which print the bitmap from memory (for example, using the TPrinter class and drawing the bitmap directly in the printer canvas)... you will learn how checking the source file of the TfrxBMPExport class.
Take this untested code as an example which will guide you how to create a new class to save/print/delete:
In production code you will want to override another methods to initialize and finalize the printer job, cleaning up, etc.
Code is based on FastReport v4.0 implementation of TfrxCustomImageExport, specially for page numbering and file naming. It may require adjustments for other FastReport versions.
您可以使用 TfrxBMPExport(frxExportImage 单元)组件将报表保存为 BMP。
例如,此代码将导出报告:
在本例中,导出组件为每个页面使用不同的文件名。如果您传递“c:\path\report.bmp”作为文件名,导出组件将生成 c:\path\report.1.bmp、c:\path\report.2.bmp 等。
与往常一样,如果您愿意,可以在任何表单/数据模块上删除并手动配置该组件。
You can use the TfrxBMPExport (frxExportImage unit) component to save the report as BMP.
For example, this code will export the report:
The Export component, in this case, uses a different file name for each page. If you pass 'c:\path\report.bmp' as the filename, the export component will generate c:\path\report.1.bmp, c:\path\report.2.bmp and such.
As usual, you can drop and manually configure the component on any form/data module if you prefer that way.