急.....怎么不用显示预览界面,就可以直接打印报表???元限感激..

shop98 2004-12-20 10:55:30
我的做法
Dim fmZprint As New fmZprint() '放预览的窗体
Dim rtProduceCard As New rtProduceCard() '打报表文件创建一个新的对象
rtProduceCard.SetDataSource(dsOrderA) '给示对象数据源(DataSet)
fmZprint.CRV.ReportSource = rtProduceCard '窗体.预览控件crv.报表
fmZprint.Show() '把预览窗体显示
现在不要把fmZprint显示出来,就直接可以打印。
我试了用rtProduceCard.PrintToPrinter(1, False, 0, 0)
但是汉打不出。其它正常
怎么办?无限感激.......
...全文
160 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
蜗牛水里爬 2004-12-22
  • 打赏
  • 举报
回复
给我看看代码好不~
yuchun0607 2004-12-21
  • 打赏
  • 举报
回复
这个是什么报表啊?我也不知道怎么打印报表,也给我一份
yuchun0607@hotmail.com
谢谢了
sean168 2004-12-21
  • 打赏
  • 举报
回复
学习
xxuu503 2004-12-21
  • 打赏
  • 举报
回复
UP
haoztao 2004-12-21
  • 打赏
  • 举报
回复
不是很清楚,帮你顶啊!
wangxt 2004-12-21
  • 打赏
  • 举报
回复
帮你顶
蜗牛水里爬 2004-12-21
  • 打赏
  • 举报
回复
shop98 (笨笨鸟),可以把全部代码贴出来吗?或者发到我邮箱里gzy11@163.com
谢谢了~
我在学报表,我连预览都不出来,郁闷。。。。。。。
Montaque 2004-12-20
  • 打赏
  • 举报
回复
要先设置打印机的名字,比如

Private Sub PrintReport(ByVal printerName As String)
Dim margins As PageMargins

' Get the PageMargins structure and set the
' margins for the report.
margins = Report.PrintOptions.PageMargins
margins.bottomMargin = 350
margins.leftMargin = 350
margins.rightMargin = 350
margins.topMargin = 350
' Apply the page margins.
Report.PrintOptions.ApplyPageMargins(margins)

' Select the printer.
Report.PrintOptions.PrinterName = printerName

' Print the report. Set the startPageN and endPageN
' parameters to 0 to print all pages.
Report.PrintToPrinter(1, False, 0, 0)
End Sub
sz_lgp 2004-12-20
  • 打赏
  • 举报
回复
直接打印rpt.PrintToPrinter(1, False, 0, 0)
3tzjq 2004-12-20
  • 打赏
  • 举报
回复
实例化报表并设置数据源后直接使用:rpt.PrintToPrinter(1, False, 0, 0)

16,555

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧