通过VB 6.0打印水晶报告 [英] Printing crystal report through VB 6.0

查看:93
本文介绍了通过VB 6.0打印水晶报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的电脑中安装了两台打印机。一个在USB端口(laserjet),另一个在LPT1(点阵)。我在crystal report 8.5中创建了报告,并使用vb 6.0代码打印它们。我的报告已经在水晶报表设计模式下设置为LPT打印机。当使用代码打印时,它总是转到Windows 7中的默认打印机(laserjet)。



我们可以有2台打印机并设置任何报告到任何打印机并使用vb 6.0代码进行打印在代码中没有提到端口和打印机名称。?



我们打印时应该通过代码更改默认打印机。?

Two printer has been installed in my computer. one in USB port (laserjet), another one is in LPT1 (dot matrix). I have created reports in crystal report 8.5 and printing them using vb 6.0 code. my reports has been set to LPT printer in crystal report design mode. when printing using code it always goto default printer (laserjet) in windows 7.

could we have 2 printer and set whichever report to whichever printer and print using vb 6.0 code without mentioning port and printer name in code.?

should we change the default printer via code when we print.?

推荐答案

我不相信你能在不提及打印机名称的情况下做到这一点,但你可以暂时更改默认打印机...



我找到了一个解决方案这里 [ ^ ]似乎工作,并且所有帐户都是这样的 http://bytes.com/topic/visual-basic/answers/573220-print-user-selected-printer-without-changing-default [ ^ ]



他们都使用打印机名称。



MS建议使用以下http://msdn.microsoft.com/en-us/library/aa227597(v=vs.60).aspx [ ^ ] ...使用对话框,用户可以选择打印机
I'm not convinced that you can do it without at least mentioning the printer name but you can temporarily change the default printer ...

I found a solution here[^] that seems to work and by all accounts so does this one http://bytes.com/topic/visual-basic/answers/573220-print-user-selected-printer-without-changing-default[^]

They both use the printer name however.

MS suggest using the following http://msdn.microsoft.com/en-us/library/aa227597(v=vs.60).aspx[^] ... using the dialog gives the users the choice of printer


这篇关于通过VB 6.0打印水晶报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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