设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

1234下一页
返回列表 发新帖
查看: 10204|回复: 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空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 分享淘帖 订阅订阅
2#
发表于 2004-11-8 23:23:00 | 只看该作者
好东东!谢谢版主!
3#
发表于 2004-11-9 01:44:00 | 只看该作者
好,顶啊
4#
发表于 2004-11-9 02:15:00 | 只看该作者
真历害(代码相当简略)我原来手工绘线,画了我不少的时间,谢谢分享

点击这里给我发消息

5#
发表于 2004-11-9 02:19:00 | 只看该作者
非常不错,Lwwvb常出精品:)
6#
发表于 2004-11-9 05:15:00 | 只看该作者
很好的东西
7#
 楼主| 发表于 2004-11-16 05:53:00 | 只看该作者
其实这个东西是旧瓶装新酒了.是一个很久很久的例子改良的.创意来自那个例子.[em01]
8#
发表于 2004-11-16 21:18:00 | 只看该作者
厉害!!
9#
发表于 2004-11-17 04:27:00 | 只看该作者
什么时候来个2003版
10#
发表于 2004-11-17 05:56:00 | 只看该作者
  它说我没有资格浏览昵!!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-5-12 04:42 , Processed in 0.085393 second(s), 34 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

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