问题描述如下:
数据在vsflexgrid(名称为vsf1)中显示
如下格式:
姓名 年龄 性别 地址
张三 30 男 北京市
李四 20 男 杭州市
点"预览"按钮,调用如下代码:
Dim rpt As New activereport1
Set rpt.Grid = vsf1
rpt.ShowActiveReport1中的代码如下:
Private m_grid As VSFlexGrid
Private bDone As BooleanProperty Set Grid(grd As VSFlexGrid)
Dim ctl As Object
Dim iLeft As Integer
Dim i As Integer
Set m_grid = grd
For i = 0 To m_grid.Cols - 1
Set ctl = Detail.Controls.Add("DDActiveReports2.Field")
ctl.Left = iLeft
ctl.Top = 0
ctl.Width = m_grid.ColWidth(i)
ctl.Tag = i
Fields.Add ctl.Name
ctl.DataField = ctl.Name
ctl.BorderStyle = 1
iLeft = iLeft + ctl.Width + 144
PrintWidth = iLeft
Next i
End PropertyPrivate Sub ActiveReport_FetchData(eof As Boolean)
Static iRow As Integer
Dim ctl As Object
Dim i As Integer If iRow < m_grid.Rows Then
For Each ctl In Detail.Controls
m_grid.Row = iRow: m_grid.Col = ctl.Tag
Fields(ctl.Name).Value = m_grid.Text
Next
iRow = iRow + 1
eof = False
End If
End Sub
结果能正确显示,可是不能显示表格线,请问如何才能显示表格线呢?
数据在vsflexgrid(名称为vsf1)中显示
如下格式:
姓名 年龄 性别 地址
张三 30 男 北京市
李四 20 男 杭州市
点"预览"按钮,调用如下代码:
Dim rpt As New activereport1
Set rpt.Grid = vsf1
rpt.ShowActiveReport1中的代码如下:
Private m_grid As VSFlexGrid
Private bDone As BooleanProperty Set Grid(grd As VSFlexGrid)
Dim ctl As Object
Dim iLeft As Integer
Dim i As Integer
Set m_grid = grd
For i = 0 To m_grid.Cols - 1
Set ctl = Detail.Controls.Add("DDActiveReports2.Field")
ctl.Left = iLeft
ctl.Top = 0
ctl.Width = m_grid.ColWidth(i)
ctl.Tag = i
Fields.Add ctl.Name
ctl.DataField = ctl.Name
ctl.BorderStyle = 1
iLeft = iLeft + ctl.Width + 144
PrintWidth = iLeft
Next i
End PropertyPrivate Sub ActiveReport_FetchData(eof As Boolean)
Static iRow As Integer
Dim ctl As Object
Dim i As Integer If iRow < m_grid.Rows Then
For Each ctl In Detail.Controls
m_grid.Row = iRow: m_grid.Col = ctl.Tag
Fields(ctl.Name).Value = m_grid.Text
Next
iRow = iRow + 1
eof = False
End If
End Sub
结果能正确显示,可是不能显示表格线,请问如何才能显示表格线呢?
解决方案 »
- 这题怎么算啊??
- 请教关于字符串对比的细节问题.
- 关于的MSCOM的几个问题
- 请问VB能实现像QQ上下滑动的那种工具菜单吗?
- 将从数据库中的一张表中查询出来的结果集写到另外一张表中
- 新学报表
- 请教高手,在线结账 !!!
- 请问各位高手怎么提取http://www.lottery.gov.cn/lottery/qxc/History.aspx?p=1中的开奖数据啊
- 如果将主键清0
- 高分征解:VB中的form不可以设置比显示屏大,如何才能使VB中的form能像Access的form那样可以比显示屏大,因为需要把A4纸的内容在一页内显示,能解决此题者另给69分。
- activereport 报表导出文件为空
- Commandialog控件设置Flags属性为多重选择+资源管理器样式后怎么确定Filename?
ctl.Border.LeftColor = vbBlack
ctl.Border.RightColor = vbBlack
ctl.Border.TopColor = vbBlack
ctl.Border.BottomStyle = ddBLSolid
ctl.Border.LeftStyle = ddBLSolid
ctl.Border.RightStyle = ddBLSolid
ctl.Border.TopStyle = ddBLSolid
If i = iTotalFields - 1 Then
ctl.Border.RightColor = vbBlack
ctl.Border.RightStyle = ddBLSolid