请教DataReport报表的打印问题????

hasi1227 2003-12-24 01:50:07
用datareport做报表,当用datareport.show显示报表窗体后单击窗体上的打印按钮,可正常打印,可是当我用函数datareport.printreport False, rptRangeAllPages 打印时无论有多少页,只打印一页。请各位高手帮助帮助,等着交活呢?
...全文
44 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
vividlm 2003-12-26
  • 打赏
  • 举报
回复
去掉unload datareport18试一试。
打印没有完毕,而卸载了该datareport
hasi1227 2003-12-26
  • 打赏
  • 举报
回复
If DataEnvironment1.rsCommand18.State <> adStateClosed Then
DataEnvironment1.rsCommand18.Close
End If
'设置打印方向纵向
X.ChngOrientationPortrait
If bPrintNothing Then
Unload DataReport18
Exit For
End If
Set DB_Tmp_BiaoInfo = DataBase_Name1.OpenRecordset("select * from biaoInfo where BiaoNum=12")
iSubTitleWidth = DataReport18.Sections.Item(1).Controls.Item(5).Width
iTitleRow = SetSubTitleRow("" & DB_Tmp_BiaoInfo("SubTitle"), iSubTitleWidth)
If iTitleRow > 1 Then
DataReport18.Sections.Item(1).Controls.Item(5).Height = 300 * iTitleRow
DataReport18.Sections.Item(1).Controls.Item(1).top = DataReport18.Sections.Item(1).Controls.Item(1).top + 300 * (iTitleRow - 1)
DataReport18.Sections.Item(1).Controls.Item(2).top = DataReport18.Sections.Item(1).Controls.Item(1).top
DataReport18.Sections.Item(1).Controls.Item(7).top = DataReport18.Sections.Item(1).Controls.Item(1).top
DataReport18.Sections.Item(1).Controls.Item(8).top = DataReport18.Sections.Item(1).Controls.Item(1).top
DataReport18.Sections.Item(1).Controls.Item(9).top = DataReport18.Sections.Item(1).Controls.Item(1).top
End If

DataReport18.Sections.Item(1).Controls.Item(3).Caption = "" & DB_Tmp_BiaoInfo("MainTitle") & "产品质量按企业规模、所在地统计表"
DataReport18.Sections.Item(1).Controls.Item(5).Caption = "" & DB_Tmp_BiaoInfo("SubTitle")
DataReport18.Sections.Item(1).Controls.Item(2).Caption = Format(Date, "yyyy-mm-dd")
DB_Tmp_BiaoInfo.Close
DataReport18.LeftMargin = (Printer.Width - DataReport18.ReportWidth) / 2
DataReport18.Width = Printer.Width - DataReport18.LeftMargin * 2
DataReport18.Sections.Item(3).KeepTogether = True
DataReport18.PrintReport False, rptRangeAllPages
DataEnvironment1.rsCommand18.Close
Unload DataReport18
Me.ZOrder 0
那个有问题????
SoHo_Andy 2003-12-25
  • 打赏
  • 举报
回复
没理由啊,你是不是有其它的代码控制

我的经验和msdn的示例一致啊
PrintReport 方法示例
第一个示例显示“打印”对话框,允许用户指定文件名和页面范围。第二个示例打印报表,而不显示对话框。

Private Sub DisplayPrintDialog()
DataReport1.PrintReport True
End Sub

Private Sub PrintWithoutDialog()
' 打印报表中的所有页面。
DataReport1.PrintReport False, rptRangeAllPages
End Sub

1,216

社区成员

发帖
与我相关
我的任务
社区描述
VB 数据库(包含打印,安装,报表)
社区管理员
  • 数据库(包含打印,安装,报表)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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