社区
多媒体
帖子详情
我用vsflexgrid + vsprint控件, 我怎么得到打印的总页数?
y_shen
2003-11-13 08:52:03
我用vsflexgrid + vsprint控件, 我怎么得到打印的总页数?
...全文
144
5
打赏
收藏
我用vsflexgrid + vsprint控件, 我怎么得到打印的总页数?
我用vsflexgrid + vsprint控件, 我怎么得到打印的总页数?
复制链接
扫一扫
分享
转发到动态
举报
AI
作业
写回复
配置赞助广告
用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+
Vs
Flex
Grid
+
Vs
Pr
int
er
打印
报表示例程序
在VB(Visual Basic)开发环境中,使用
Vs
Flex
Grid
控件
和
Vs
Pr
int
er组件可以创建和
打印
复杂的报表。
Vs
Flex
Grid
是一个强大的网格
控件
,允许开发者在应用程序中显示和编辑多行多列的数据,而
Vs
Pr
int
er则提供了方便的
打印
...
vs
flex
grid
8.0_
控件
_
VS
Flex
Grid
8.0_
**
VS
Flex
Grid
8.0
控件
详解** 在Visual Basic (VB) 编程环境中,
控件
是构建用户界面的关键元素,它们提供了与用户交互的图形化接口。`
VS
Flex
Grid
8.0` 是一个功能强大的网格
控件
,适用于开发Windows应用程序。这个...
VS
Flex
Grid
+Access+多条件过滤器.rar
此代码包含
VS
Flex
Grid
控件
,源代码,使用前请先注册
VS
Flex
Grid
,请先右键管理员身份运行“首先先注册
控件
.bat”文件,进行
控件
注册,更换位置后,记得重新注册
控件
,否则,可能位置引用不对。
Vs
Flex
Grid
8表格
控件
- `
vs
pr
int
8.ocx`:
打印
控件
,用于实现表格的
打印
功能。 4. **
Vs
Grid
属性方法演示.rar** 这个压缩文件可能包含了一个示例项目,演示了
Vs
Flex
Grid
8的各种属性和方法的使用,通过解压并运行,开发者可以直观地学习...
vs
flex
grid
8.0
控件
包,WIN7 64位系统可用
【标题】"
vs
flex
grid
8.0
控件
包,WIN7 64位系统可用" 涉及的核心知识点是关于Visual Studio中的一个经典
控件
——
Vs
Flex
Grid
,以及其在Windows 7 64位操作系统下的兼容性问题。
Vs
Flex
Grid
是一款用于Windows应用程序...
多媒体
808
社区成员
8,274
社区内容
发帖
与我相关
我的任务
多媒体
VB 多媒体
复制链接
扫一扫
分享
社区描述
VB 多媒体
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章