怎么打印FLEXGRID里的内容?

Dickson 2004-12-11 03:22:33
我想打印FLEXGRID表格.....
...全文
78 8 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
yzrterry 2004-12-11
  • 打赏
  • 举报
回复
输出到EXCEL也可....
hongsongboy 2004-12-11
  • 打赏
  • 举报
回复
跟我联系吧,需要控件还是源代码?(控件免费,源代码收费.)
nathanboy@163.com
QQ:11533609
leongwong 2004-12-11
  • 打赏
  • 举报
回复
真的假的,这么牛!有谁这么慷慨呀!
我不信!leong_wang@hotmail.com
aohan 2004-12-11
  • 打赏
  • 举报
回复
ERP源码,有哎,免费提供,呵呵
gaobingaobin 2004-12-11
  • 打赏
  • 举报
回复
二楼的老兄,我要个ERP源码,多少钱?尽管狮子大开口!
aohan 2004-12-11
  • 打赏
  • 举报
回复
发现二楼的真会做生意,老大就比较慷慨,呵呵
lihonggen0 2004-12-11
  • 打赏
  • 举报
回复
下载:
http://www.torontoservice.com/lihonggen/howto_print_flexgrid.zip
lihonggen0 2004-12-11
  • 打赏
  • 举报
回复
Private Sub PrintFlexGrid(ByVal ptr As Object, ByVal flx As _
MSFlexGrid, ByVal xmin As Single, ByVal ymin As Single)
Const GAP = 60

Dim xmax As Single
Dim ymax As Single
Dim X As Single
Dim c As Integer
Dim r As Integer

With ptr.Font
.Name = flxData.Font.Name
.Size = flxData.Font.Size
End With

With flxData
' See how wide the whole thing is.
xmax = xmin + GAP
For c = 0 To .Cols - 1
xmax = xmax + .ColWidth(c) + 2 * GAP
Next c

' Print each row.
ptr.CurrentY = ymin
For r = 0 To .Rows - 1
' Draw a line above this row.
If r > 0 Then ptr.Line (xmin, _
ptr.CurrentY)-(xmax, ptr.CurrentY)
ptr.CurrentY = ptr.CurrentY + GAP

' Print the entries on this row.
X = xmin + GAP
For c = 0 To .Cols - 1
ptr.CurrentX = X
ptr.Print BoundedText(ptr, .TextMatrix(r, _
c), .ColWidth(c));
X = X + .ColWidth(c) + 2 * GAP
Next c
ptr.CurrentY = ptr.CurrentY + GAP

' Move to the next line.
ptr.Print
Next r
ymax = ptr.CurrentY

' Draw a box around everything.
ptr.Line (xmin, ymin)-(xmax, ymax), , B

' Draw lines between the columns.
X = xmin
For c = 0 To .Cols - 2
X = X + .ColWidth(c) + 2 * GAP
ptr.Line (X, ymin)-(X, ymax)
Next c
End With
End Sub

' Truncate the string so it fits within the width.
Private Function BoundedText(ByVal ptr As Object, ByVal txt _
As String, ByVal max_wid As Single) As String
Do While ptr.TextWidth(txt) > max_wid
txt = Left$(txt, Len(txt) - 1)
Loop
BoundedText = txt
End Function

1,217

社区成员

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

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