设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

1234下一页
返回列表 发新帖
查看: 10954|回复: 33
打印 上一主题 下一主题

[其它] [LWWVB]报表免线工具!!极力推荐!!!

[复制链接]
跳转到指定楼层
1#
发表于 2004-11-8 22:22:00 | 只看该作者 回帖奖励 |正序浏览 |阅读模式


http://www.office-cn.net/forum.p ... jQ4MTI5fDc1fDIyNDU3
这个免线工具就在上面。不要哭。。。[em05]

主要的类模块代码

Option Compare Database
Option Explicit

Dim Ctl As Control
Dim i As Integer

Dim x() As Long
Dim p As Integer
Dim MaxX As Long
Dim MaxBound As Integer

Dim LastRptName As String
Dim LastSection As AcSection

Public OutWidth As Integer
Public InWidth As Integer

'在报表中要画线的段的print事件 调用此参数
Public Sub DrawGrid(rpt As Report, DrawSection As AcSection, Optional DrawLR As Boolean = True, Optional DrawTop As Boolean = False, Optional DrawBottom As Boolean = False)
  ''''假如要绘制的对象或段不同,就重查找相应的控件位置
  If LastRptName <> rpt.Name Or LastSection <> DrawSection Then
    LastRptName = rpt.Name
    LastSection = DrawSection

    MaxBound = rpt.Section(DrawSection).Controls.Count
    ReDim x(MaxBound)

    p = 0: MaxX = 0
    For i = 1 To MaxBound
      Set Ctl = rpt.Section(DrawSection).Controls(i - 1)
      x(i) = Ctl.Left + Ctl.Width
      If x(i) > MaxX Then MaxX = x(i): p = i
    Next i


  End If

  rpt.DrawWidth = InWidth
  For i = 1 To MaxBound
    If i <> p Then rpt.Line (x(i), 0)-(x(i), rpt.Height)
  Next i

  rpt.DrawWidth = OutWidth
  If DrawLR Then
    rpt.Line (0, 0)-(0, rpt.Height)  '''画左线
    rpt.Line (rpt.Width, 0)-(rpt.Width, rpt.Height) ''画右线
  End If

  If DrawTop Then rpt.Line (0, 0)-(rpt.Width, 0)  '''画上线


  '''画底线
  If DrawBottom = False Then rpt.DrawWidth = InWidth
  rpt.Line (0, rpt.Height)-(rpt.Width, rpt.Height)

End Sub


分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 分享淘帖 订阅订阅
34#
发表于 2007-2-14 06:46:00 | 只看该作者
谢了
33#
发表于 2007-2-3 23:44:00 | 只看该作者
32#
发表于 2007-1-31 05:55:00 | 只看该作者
谢谢分享。收下好好学习一下。
31#
发表于 2007-1-13 00:46:00 | 只看该作者
看不到,怎么才能看得到?
30#
发表于 2006-10-16 06:00:00 | 只看该作者
谢谢楼主
29#
发表于 2006-6-24 23:28:00 | 只看该作者
看不了啊,这个连接到的不是本论坛上的吗?

希望斑竹能贴上来
28#
发表于 2005-1-20 05:05:00 | 只看该作者
看看
27#
发表于 2005-1-20 00:23:00 | 只看该作者
非常不错,正是我们需要的,谢谢!!!
26#
发表于 2004-12-20 04:02:00 | 只看该作者
收下,顶。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-9-20 21:08 , Processed in 0.128271 second(s), 35 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表