从VB.Net打印Crystal Reports [英] Printing Crystal Reports from VB.Net
问题描述
如何在不使用ReportViewer的情况下从VB.Net打印Crystal Report。我想批量打印多个报告并按一个按钮打印所有报告。
How do I print a Crystal Report from VB.Net without using the ReportViewer. I want to batch multiple reports and print them all by pressing one button.
推荐答案
您将报告加载到ReportDocument中,传递所需的任何数据库登录信息,以及参数然后调用printtoprinter方法。
Dim myReport作为新的ReportDocument()
myReport.Load(" C:\ myReport.rpt")
'传递数据库和参数信息这里
myReport.PrinttoPrinter(1,true,0,0)'这会将所有页面的一个副本打印到默认打印机,并整理它们
You load the report into the ReportDocument, pass any database logon information needed, as well as parameters then call the printtoprinter method.
Dim myReport as new ReportDocument()
myReport.Load("C:\myReport.rpt")
'Pass database and Parameter info here
myReport.PrinttoPrinter(1,true,0,0) 'This prints one copy of all pages to the default printer, and collates them
这篇关于从VB.Net打印Crystal Reports的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!