pb如何得到数据窗口的sql语句
ls_filter_condition 需要从新写的条件
get_leftstring 截取字符函数
dw_1.settransobject( sqlca )
获取 Is_sql = dw_1.getsqlselect( )
Is_sql = get_leftstring (Is_sql,'WHERE')
new_sql =Is_sql+' WHERE '
new_sql = new_sql + ls_filter_condition
从新给数据窗口sql语句 dw_1.setsqlselect(new_sql)
pb中怎么获取数据窗口的列名
Getcolumn 得到的是当前powerobject的字段的数量。调用语法: getcolumns ( powerobject apo_data, ref string as_columns[], ref string as_error )Int li_colcount,i//取列数Choose Case TypeOf(apo_data) Case datawindow! uo_datawindow_cics ldw ldw= apo_data li_colcount = Integer(ldw.Describe("DataWindow.Column.Count")) Case datawindowchild! datawindowchild ldwc ldwc = apo_data li_colcount = Integer(ldwc.Describe("DataWindow.Column.Count")) Case datastore! uo_datastore_cics lds lds = apo_data li_colcount = Integer(lds.Describe("DataWindow.Column.Count")) Case Else as_error = '调用GetColumns时入参错误:powerobject的类型不正确' Return -1End ChooseIf Not li_colcount > 0 Then as_error = '取数据窗口的列数不成功!' Return -1End If //取列名String columnnames[],ls_colnameFor i = 1 To li_colcount Choose Case TypeOf(apo_data) Case datawindow! ls_colname = ldw.Describe("#" + String(i) +".Name") Case datawindowchild! ls_colname = ldwc.Describe("#" + String(i) +".Name") Case datastore! ls_colname = lds.Describe("#" + String(i) +".Name") End Choose If IsNull(ls_colname) Or ls_colname = '?' Or ls_colname = '!' Then as_error = '调用GetColumns,取数据窗口的列名称不成功:'+String(i) Return -1 End If as_columns[i] = Upper(ls_colname)Next