Rss & SiteMap

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

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

标题:[求助]增加代码

1楼
易服 发表于:2009/7/2 11:44:00

图片点击可在新窗口打开查看此主题相关图片如下:打开.png
图片点击可在新窗口打开查看

图片点击可在新窗口打开查看此主题相关图片如下:增加.png
图片点击可在新窗口打开查看
想增加一段代码试了多次不成功,请大师指点:不选乡名统计到乡;选择乡名统计到村
以下代码是正确的
If ( e.Form.Controls("RadioButton1").Checked Or e.Form.Controls("RadioButton2").Checked Or e.Form.Controls("RadioButton3").Checked)= False Then
    Messagebox.Show("选一个项目")
    Return
End If
If ( e.Form.Controls("RadioButton4").Checked Or e.Form.Controls("RadioButton5").Checked )= False Then
    Messagebox.Show("选一个面积")
    Return
End If
Dim Filter As String
With e.Form.Controls("ComboBox1")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "乡名= '" & .Value & "'"
    End If
End With
Dim g As New CrossTableBuilder("交叉统计", DataTables("总览"),Filter)
If e.Form.Controls("RadioButton1").Checked Then g.VGroups.AddDef("造林年度","{0}年_总面积")
    If e.Form.Controls("RadioButton2").Checked Then g.VGroups.AddDef("造林类别","{0}_总面积")
        If e.Form.Controls("RadioButton3").Checked Then  g.VGroups.AddDef("林种","{0}_总面积")
            If e.Form.Controls("RadioButton4").Checked Then  g.Totals.AddDef("保存面积","总面积")
                If e.Form.Controls("RadioButton5").Checked Then  g.Totals.AddDef("退耕地","总面积")
                    g.HGroups.AddDef("乡名")
                    g.HorizontalTotal = True
                    g.VerticalTotal = True
                    g.HorizontalProportion = True
                    g.VerticalProportion = True
                    g.Build()
                    MainTable = Tables("交叉统计")
[此贴子已经被作者于2009-7-2 16:19:32编辑过]
2楼
yangming 发表于:2009/7/2 11:55:00
发文件吧,便于测试
3楼
易服 发表于:2009/7/2 12:56:00

文件已发(一楼),烦劳写代码

[此贴子已经被作者于2009-7-2 12:56:17编辑过]
4楼
易服 发表于:2009/7/2 15:07:00
自己顶
5楼
yangming 发表于:2009/7/2 15:16:00
 将一楼的红字行,改成 

    If cmb.Value  IsNot Nothing Then              
  g.HGroups.AddDef("村名")
Else
  g.HGroups.AddDef("乡名")
End If
6楼
易服 发表于:2009/7/2 15:23:00
谢谢 !通过测试吗?                                                                                                                     1
7楼
yangming 发表于:2009/7/2 15:28:00
以下是引用易服在2009-7-2 15:23:00的发言:
谢谢 !通过测试吗?                                                                                                                     1

不通过我也不会上传的,呵

If ( e.Form.Controls("RadioButton1").Checked Or e.Form.Controls("RadioButton2").Checked Or e.Form.Controls("RadioButton3").Checked)= False Then
    Messagebox.Show("选一个项目")
    Return
End If
If ( e.Form.Controls("RadioButton4").Checked Or e.Form.Controls("RadioButton5").Checked )= False Then
    Messagebox.Show("选一个面积")
    Return
End If
Dim Filter As String
Dim cmb As WinForm.ComboBox=e.Form.Controls("ComboBox1")
    If cmb.Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
         Filter = Filter & "乡名= '" & cmb.Value & "'"
    End If
Dim g As New CrossTableBuilder("交叉统计", DataTables("总览"),Filter)
If e.Form.Controls("RadioButton1").Checked Then g.VGroups.AddDef("造林年度","{0}年_总面积")
    If e.Form.Controls("RadioButton2").Checked Then g.VGroups.AddDef("造林类别","{0}_总面积")
        If e.Form.Controls("RadioButton3").Checked Then  g.VGroups.AddDef("林种","{0}_总面积")
            If e.Form.Controls("RadioButton4").Checked Then  g.Totals.AddDef("保存面积","总面积")
                If e.Form.Controls("RadioButton5").Checked Then  g.Totals.AddDef("退耕地","总面积")
                     If cmb.Value  IsNot Nothing Then              
  g.HGroups.AddDef("村名")
Else
  g.HGroups.AddDef("乡名")
End If
                   g.HorizontalTotal = True
                    g.VerticalTotal = True
                    g.HorizontalProportion = True
                    g.VerticalProportion = True
                    g.Build()
                    MainTable = Tables("交叉统计")

[此贴子已经被作者于2009-7-2 15:30:38编辑过]
共7 条记录, 每页显示 10 条, 页签: [1]

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

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