• datawindow指标获取


    1、得到当前鼠标所指对象所在的带区
      string str_band
      str_band=GetBandAtPointer() //得到当前鼠标所指对象所在的带区
      str_band=left(str_band,(pos(str_band,'~t') - 1))//得到"header"、"detail"等
      if str_band<>'header' then return //单击非头区,退出
    2、得到鼠标指向的列对象名
      str_object=GetObjectAtPointer() //得到当前鼠标所指对象名
      str_object=left(str_object,(pos(str_object,'~t') - 1))
      //得到列对象名(默认为列名_t为列标题)
      str_column=left(str_object,(len(str_title) - 2))
      //判断该名称是否为列名字
      if this.describe(str_column+".band")='!' then return //非是列名,即列标题不是按正常规律起名的。
    3、得到当前行、列,总行、列 //this 针对数据窗口而言
      li_col = this.GetColumn()
      li_ColCount = long(describe(this,"datawindow.column.count"))
      ll_row = this.GetRow()
      ll_RowCount = this.RowCount()
      //设置当前行、列
      scrolltorow(this,ll_Row)
      setrow(this,ll_Row)
      setcolumn(this,li_col)
      this.SetFocus()
    4、得到所有列标题
      ll_colnum = Long(dw_1.object.datawindow.column.count)
      for i = 1 to ll_colnum
       //得到标题头的名字
       ls_colname = dw_1.describe('#' + string(i) + ".name") + "_t"
       ls_value = dw_1.describe(ls_colname + ".text")
      next
    5、如何用代码取得数据窗口汇总带计算列的值?  
      String ls_value
      ls_value = dw_1.Describe("Evaluate("'compute_1',1)")
      //如果是数值型,要转换。
    6、取得单击的列标题、列名、数据库字段名
      string ls_dwo
      long ll_pos
      string ls_type
      string ls_title
      string ls_column
      string ls_dbname
      if Not KeyDown(KeyControl!) then return
      ls_dwo = dwo.Name
      if trim(ls_dwo) = '' or isnull(ls_dwo) then return
      ls_type = This.describe(ls_dwo + '.type')
      if ls_type = 'column' then
       ls_title = This.describe(ls_dwo + '_t.text')//标题
       ls_column = This.describe(ls_dwo + '.Name') //数据窗口列名
       ls_dbname = This.describe(ls_dwo + '.dbname') //数据库中字段名
       messagebox('信息', '标 题 文 本 :' + ls_title + &
       '~r~n数据窗口列名 :' + ls_column + &
       '~r~n数据库中字段名:' + ls_dbname )
      end if
    7、窗口为w_gcde内,放入一个DW_1,如何得到dw_1内的某列值yuonghu_id列的内容
      long lng_column_count
      integer i
      string str_column[] //列名
      string str_column_text[]  //text的名字
      //得到数据窗口的总列数
      lng_column_count = long(dw_1.Describe("DataWindow.Column.Count"))
      //循环依次读取
      for i = 1 to lng_column_count
       str_column = dw_1.Describe("#"+string(i)+".name")
       str_column_text = dw_1.Describe(str_column + "_t.text")
      next
    8、定义要打印的页码
      dw_1.Modify("DataWindow.Print.Page.Range='"+sle_1.text+"'")
      dw_1.print()
    9、取到当前是第几页
      dw_1.describe("evaluate('page()',"+string(dw_1.getrow())+")")
      //注意返回值是STRING型的
    10、每15行统计一次
      在 summary 栏中写 ceiling(Getrow()/15)
    11、如何判断当前行是不是当前页中的最后一行
      if dw_1.getrow()=long(dw_1.describe("datawindow.lastrowonpage")) then
      else
      end if

  • 相关阅读:
    sql server 2008 评估期已过期解决办法 + vs2008破解(转) 狼人:
    发现godaddy亚太机房主机比较慢,怎样转到godaddy美国机房 狼人:
    模拟提交有文件上传的表单(通过http模拟上传文件) 狼人:
    WordPress 批量关闭和打开评论功能 狼人:
    英文seo外链资源整合,怎么样找国外博客资源? 狼人:
    WindowsServer2003+IIS6+ASP+NET+PHP+MSSQL+MYSQL配置说明 |备份于waw.cnblogs.com 狼人:
    Excel表格的35招必学秘技(学会计的快来转载,留着以后用) 狼人:
    MSN去窗口广告方法http://apatch.org/downloads/ 狼人:
    js 实现谷歌浏览器中隐藏标签后setInterval事件暂停 狼人:
    SQL Server 2008过期导致MSSQLSERVER服务无法启动 狼人:
  • 原文地址:https://www.cnblogs.com/djd66/p/16205430.html
Copyright © 2020-2023  润新知