社区
多媒体
帖子详情
我用vsflexgrid + vsprint控件, 我怎么得到打印的总页数?
y_shen
2003-11-13 08:52:03
我用vsflexgrid + vsprint控件, 我怎么得到打印的总页数?
...全文
131
5
打赏
收藏
我用vsflexgrid + vsprint控件, 我怎么得到打印的总页数?
我用vsflexgrid + vsprint控件, 我怎么得到打印的总页数?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
5 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
zerg2001
2004-03-17
打赏
举报
回复
这个是不行的,在打印进行时,PageCount得不到总页数的。
因此你如果要在报表上添加总页数是不行的。
有个傻方法,你可先提交,提交完成后,PageCount就是总页数了,把它赋值给变量V1,用V1作为总页数,再提交一次。
没办法中的办法。
axer
2004-03-04
打赏
举报
回复
关键是:
当前页 = " 第 " + Trim(str(.PreviewPage)) + " 页"
总页数 = " 共 " + Trim(str(.PageCount)) + " 页"
axer
2004-03-04
打赏
举报
回复
忘了说明,以上是我以前写过的一段代码: 我用ActiveBar21工具条,内含上边的按钮和下面的状态栏, 页数显示在状态栏里面,当前页和总页数都有的,供参考.
axer
2004-03-04
打赏
举报
回复
Private Sub ActiveBar21_ToolClick(ByVal Tool As ActiveBar2LibraryCtl.Tool)
Dim bOK%, sMsg$
Select Case Tool.Name
Case "zoomout":
VSPrinter1.Zoom = VSPrinter1.Zoom + VSPrinter1.ZoomStep
Case "zoomin":
VSPrinter1.Zoom = VSPrinter1.Zoom - VSPrinter1.ZoomStep
Case "page": '选择纸张设置
VSPrinter1.PrintDialog (pdPageSetup)
With VSPrinter1
.StartDoc
.Zoom = 75 '显示比例
.RenderControl = bsemployee.vg.hwnd '把网格内容传递给vsView显示
.EndDoc
ActiveBar21.Bands(1).Tools(0).Caption = " 第 " + Trim(str(.PreviewPage)) + " 页"
ActiveBar21.Bands(1).Tools(1).Caption = " 共 " + Trim(str(.PageCount)) + " 页"
If .PageCount = 1 Then
ActiveBar21.Bands(0).Tools(0).Enabled = True
ActiveBar21.Bands(0).Tools(1).Enabled = True
ActiveBar21.Bands(0).Tools(3).Enabled = False
ActiveBar21.Bands(0).Tools(4).Enabled = False
Else
ActiveBar21.Bands(0).Tools(0).Enabled = True
ActiveBar21.Bands(0).Tools(1).Enabled = True
ActiveBar21.Bands(0).Tools(3).Enabled = False
ActiveBar21.Bands(0).Tools(4).Enabled = True
End If
End With
Case "back": '前页
With VSPrinter1
If .PreviewPage > 1 Then
.PreviewPage = .PreviewPage - 1
If .PreviewPage = 1 Then
ActiveBar21.Bands(0).Tools(4).Enabled = True
ActiveBar21.Bands(0).Tools(3).Enabled = False
ActiveBar21.Bands(1).Tools(0).Caption = " 第 " + Trim(str(.PreviewPage)) + " 页"
Else
ActiveBar21.Bands(0).Tools(4).Enabled = True
ActiveBar21.Bands(0).Tools(3).Enabled = True
ActiveBar21.Bands(1).Tools(0).Caption = " 第 " + Trim(str(.PreviewPage)) + " 页"
End If
Else
If .PreviewPage = 1 Then
ActiveBar21.Bands(0).Tools(4).Enabled = True
ActiveBar21.Bands(0).Tools(3).Enabled = False
ActiveBar21.Bands(1).Tools(0).Caption = " 第 " + Trim(str(.PreviewPage)) + " 页"
Else
ActiveBar21.Bands(0).Tools(4).Enabled = True
ActiveBar21.Bands(0).Tools(3).Enabled = True
ActiveBar21.Bands(1).Tools(0).Caption = " 第 " + Trim(str(.PreviewPage)) + " 页"
End If
End If
End With
Case "forward": '后页
With VSPrinter1
If .PreviewPage < .PageCount Then
.PreviewPage = .PreviewPage + 1
If .PreviewPage = .PageCount Then
ActiveBar21.Bands(0).Tools(3).Enabled = True
ActiveBar21.Bands(0).Tools(4).Enabled = False
ActiveBar21.Bands(1).Tools(0).Caption = " 第 " + Trim(str(.PreviewPage)) + " 页"
Else
ActiveBar21.Bands(0).Tools(4).Enabled = True
ActiveBar21.Bands(0).Tools(3).Enabled = True
ActiveBar21.Bands(1).Tools(0).Caption = " 第 " + Trim(str(.PreviewPage)) + " 页"
End If
Else
If .PreviewPage = .PageCount Then
ActiveBar21.Bands(0).Tools(3).Enabled = True
ActiveBar21.Bands(0).Tools(4).Enabled = False
ActiveBar21.Bands(1).Tools(0).Caption = " 第 " + Trim(str(.PreviewPage)) + " 页"
Else
ActiveBar21.Bands(0).Tools(4).Enabled = True
ActiveBar21.Bands(0).Tools(3).Enabled = True
ActiveBar21.Bands(1).Tools(0).Caption = " 第 " + Trim(str(.PreviewPage)) + " 页"
End If
End If
End With
Case "print": '打印输出
VSPrinter1.PrintDoc
Case "quit": Unload Me
End Select
End Sub
planetike
2003-11-13
打赏
举报
回复
PreviewPages能行吗?
还有,能请你发一个vsprint打印vsflexgrid表格的例子给我吗?谢谢。
planetike@hotmail.com
vb+
VsFlexGrid
+
VsPrint
er
打印
报表示例程序
vb+
VsFlexGrid
+
VsPrint
er
打印
报表示例程序
vsflexgrid
8.0_
控
件_
VSFlexGrid
8.0_
一个有用的
控
件,
vsflexgrid
8.0,用于VB编程。
VSFlexGrid
+Access+多条件过滤器.rar
此代码包含
VSFlexGrid
控
件,源代码,使用前请先注册
VSFlexGrid
,请先右键管理员身份运行“首先先注册
控
件.bat”文件,进行
控
件注册,更换位置后,记得重新注册
控
件,否则,可能位置引用不对。
VsFlexGrid
8表格
控
件
VsFlexGrid
8表格
控
件,挺出名的表格
控
件
vsflexgrid
控
件
vsflexgrid
控
件
vsflexgrid
控
件
vsflexgrid
控
件
多媒体
809
社区成员
8,275
社区内容
发帖
与我相关
我的任务
多媒体
VB 多媒体
复制链接
扫一扫
分享
社区描述
VB 多媒体
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章