执行printtoprinter方法时发生异常。 [英] Exception occured while executing printtoprinter method.

查看:354
本文介绍了执行printtoprinter方法时发生异常。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Value of '-1925' is not valid for 'bottom'.'bottom' must be greater than or equal to 0.
exception occured while printing crystal report using print to printer method.





我的尝试:





What I have tried:

POSReport = New ReportDocument()
        POSReport.Load(sfilename)


        CrystalReportViewer1.ReportSource = POSReport
        CrystalReportViewer1.Refresh()
 POSReport.PrintOptions.PrinterName = sDefaultPrinterName
            POSReport.PrintToPrinter(1, False, 0, 0)

推荐答案

阅读错误信息,如果尝试,则无法更清楚:

Read the error message, it couldn;t be any clearer if it tried:
Value of '-1925' is not valid for 'bottom'.'bottom' must be greater than or equal to 0.

所以底部属性为负数,CR无法使用,这是可以理解的。 Antipaper还没有发明。



所以使用调试器,找出它为什么是负面的。首先找到您设置值的位置,以及将其设置为负值的原因。我们无法为您执行此操作:我们无权访问您的应用,您的数据或打印机!

So the bottom property is negative, and CR can't work with that, understandably. Antipaper has not been invented yet.

So use the debugger, and find out why it's negative. Start by finding where you set the value, and why you set it to a negative value. We can't do that for you: we don't have access to your app, your data, or your printer!


这篇关于执行printtoprinter方法时发生异常。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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