foxtable所有范例代码资料

上传人:E**** 文档编号:107077258 上传时间:2019-10-17 格式:DOC 页数:274 大小:1.14MB
返回 下载 相关 举报
foxtable所有范例代码资料_第1页
第1页 / 共274页
foxtable所有范例代码资料_第2页
第2页 / 共274页
foxtable所有范例代码资料_第3页
第3页 / 共274页
foxtable所有范例代码资料_第4页
第4页 / 共274页
foxtable所有范例代码资料_第5页
第5页 / 共274页
点击查看更多>>
资源描述

《foxtable所有范例代码资料》由会员分享,可在线阅读,更多相关《foxtable所有范例代码资料(274页珍藏版)》请在金锄头文库上搜索。

1、=Excel图表.foxdb=项目事件AfterOpenProjectForms(图表设置).Open()计划管理表事件窗口表事件窗口与控件事件图表设置_AfterLoadDim x,y As StringDim i As IntegerFor Each c As Col In Currenttable.Cols If c.Visible Then i = i + 1 If c.Datacol.IsNumeric Then y = y & |【 & i & 】 & c.Caption Else x = x & |【 & i & 】 & c.Caption End If End IfNexte.

2、Form.Controls(CheckedComboBox1).ComboList = y.Trim(|)e.Form.Controls(CheckedComboBox2).ComboList = x.Trim(|)图表设置_Button1_ClickexStr = 图表区Forms(图表外观).Open图表设置_Button2_ClickexStr = 绘图区Forms(图表外观).Open图表设置_Button3_ClickexStr = 图例Forms(图表外观).Open图表设置_Button4_ClickexStr = 标题Forms(图表外观).Open图表设置_Button5_C

3、lick对数据列验证Dim y As String = e.Form.Controls(CheckedComboBox1).ValueDim x As String = e.Form.Controls(CheckedComboBox2).ValueIf y = Then MessageBox.Show(数据系列中的数值轴(Y)必须设置! ,信息提示,MessageBoxButtons.OK,MessageBoxIcon.Warning) ReturnElse If e.Form.Controls(ListBox1).ComboList = Then MessageBox.Show(数值轴(Y)

4、不能全部设置为次坐标轴! ,信息提示,MessageBoxButtons.OK,MessageBoxIcon.Warning) Return End IfEnd IfDim ksl,jsl As Integer x轴的起始列与结束列If x Then Dim xs As String() = x.Split(,) If xs.Length 1 如果x轴有多列 Dim xsn(xs.Length-1) As Integer For n As Integer = 0 To xs.Length - 1 xsn(n) = xs(n).SubString(1,xs(n).LastIndexOf(】)-1

5、) Next Array.Sort(xsn) 得到各列的序号,并排序 For n As Integer = 1 To xsn.Length - 1 If xsn(n) - xsn(n-1) 1 MessageBox.Show(如果X轴的分类列有多个, 那么它必须是连续的! ,信息提示,MessageBoxButtons.OK,MessageBoxIcon.Warning) Return End If Next ksl = xsn(0) jsl = xsn(xsn.Length-1) Else ksl = x.SubString(1,x.LastIndexOf(】)-1) jsl = ksl E

6、nd IfEnd If定义ExcelDim f As String = ProjectPath & Excel数据.xlsDim t As Table = CurrentTableDim flg As New SaveExcelFlagsflg.CellStyle = Truet.SaveExcel(f,t.Name,flg) 导出数据到指定文件Dim App As New MSExcel.ApplicationApp.DisplayAlerts = FalseDim Wb As MSExcel.WorkBook = App.WorkBooks.Open(f)Dim Ws As MSExcel

7、.WorkSheet = Wb.WorkSheets(1)Dim i As Integer = e.Form.Controls(NumericComboBox1).Value 指定大小Dim j As Integer = e.Form.Controls(NumericComboBox2).ValueDim rg As MSExcel.Range = Ws.Cells(t.HeaderRows + t.Rows.Count,1)Dim Co As MSExcel.ChartObject = Ws.ChartObjects.Add(rg.Left,rg.Top,i,j) 在最末行的第一个单元格处生

8、成图表Ws.DrawingObjects(1).Shadow = e.Form.Controls(CheckBox1).Checked 阴影Ws.DrawingObjects(1).RoundedCorners = e.Form.Controls(CheckBox2).Checked 圆角Dim Cht As MSExcel.Chart = Co.ChartFunctions.Execute(App_Wgsz,图表区,Wb,Cht,1,2,3) 设置图表区外观,此行不能放到后面,否则将替代其它对象的设置图表类型并指定y轴和绘图方式Cht.ChartType = Functions.Execut

9、e(App_ChartType,e.Form.Controls(ComboBox1).Value,e.Form.Controls(ComboBox2).Value)Dim cs As String() = y.Split(,)Dim lh As IntegerDim ar As StringDim first As Integer = CurrentTable.HeaderRows + 1 数据记录的起始行Dim last As Integer = CurrentTable.HeaderRows + CurrentTable.Rows.Count 数据记录的结束行For Each c As S

10、tring In cs lh = c.SubString(1,c.LastIndexOf(】)-1) ar = ar & , & Functions.Execute(App_ColChr,lh) & first & : & Functions.Execute(App_ColChr,lh) & lastNextar = ar.Trim(,)rg = Ws.Range(ar)If e.Form.Controls(ComboBox2).Value.Contains(饼图) Then Dim ars As String() = ar.Split(,) If ars.Length 1 Then rg =

11、 Ws.Range(ars(0) End IfEnd IfIf e.Form.Controls(CheckBox10).Checked Then Cht.SetSourceData(rg,MSExcel.XlRowCol.xlColumns) 数据产生自列Else Cht.SetSourceData(rg,MSExcel.XlRowCol.xlRows) 数据产生于行End IfFunctions.Execute(App_Wgsz,绘图区,Wb,Cht,4,5,6) 绘图区的外观设置指定x轴的分类列区域Dim xbz As StringIf x Then xbz = = & Ws.Name &

12、 !R & first & C & ksl & :R & last & C & jsl If e.Form.Controls(CheckBox5).Checked Then 合并单元格 For m As Integer = jsl To ksl Step -1 Dim hh As Integer = first For n As Integer = first+1 To last+1 If Ws.Cells(n,m).Value Ws.Cells(hh,m).Value Then rg = Ws.Range(Ws.Cells(hh,m),Ws.Cells(n-1,m) If m = ksl Then rg.Merge rg.VerticalAlignment = MSExcel.Constants.xlCenter hh = n Elseif Ws.Cells(n,m-1).Value = Ws.Cells(hh,m-1).Value Then rg.Merge rg.VerticalAlignment = MSExcel.Constants.xlCenter hh = n End If End If Next Next End IfEnd If设置每个数据系列Dim czb

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 办公文档 > 其它办公文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号