Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共12 条记录, 每页显示 10 条, 页签: [1] [2]
[浏览完整版]

标题:(请教)这个报表的代码应怎么样写

11楼
blackzhu 发表于:2008/11/25 17:16:00
以下是引用gdtgl在2008-11-25 1:14:00的发言:

试了1天1晚时间了,终于写出来了(分享1下):

dim barow as row = tables("表A").current
dim babianhao as string = barow("编号")

Dim doc As New Printdoc
Dim rt As New prt.RenderTable

dim af as table = Tables("表A.表F")
With Tables("表A.表F")
rt = New prt.RenderTable
rt.Style.GridLines.All = prt.Linedef.Default '网格线为默认类型
For n As integer = 0 To .Rows.Count - 1      
    rt.Cells(0,0).Text = "编号"
    rt.Cells(0,1).Text ="采样编号"   
    rt.Cells(0,2+n).Text = .rows(n)("项目")

Dim cmd As New SQLCommand '定义一个SQL命令
Dim dt As DataTable '定义一个数据表变量
   cmd.CommandText = "Select 编号,采样编号,值 from {表C} where 编号 = '"& babianhao &"' and 项目= '"& Tables("表A.表F").rows(n)("项目") &"' "
   dt = cmd.ExecuteReader() '生成一个临时表
   For r As integer = 0 To dt.DataRows.Count - 1
        rt.Cells(r+1,0).Text = dt.DataRows(r)("编号")
        rt.Cells(r+1,1).Text = dt.DataRows(r)("采样编号")
        rt.Cells(r+1,2+n).Text = dt.DataRows(r)("值")
   Next

next
End With
doc.Body.Children.Add(rt)
doc.Preview

[此贴子已经被作者于2008-11-25 3:03:25编辑过]

 高手,佩服。关于报表我只能按照帮助上的搞搞还行。

12楼
gdtgl 发表于:2008/11/26 9:30:00

还在继续做(是有关检验这块的:检验的标准与项目是特别多而且是变化,不可能增加1个检验项目就要修改报表和表结构),

完成后,我也发上来参赛,(报表是选择用:专业报表,我想应有参考的价值吧)

共12 条记录, 每页显示 10 条, 页签: [1] [2]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .01563 s, 2 queries.