动态创建数据窗口的问题

sunpb 2002-02-24 01:55:04
ds_mydata.dataobject='d_label'
sqlSyntax = idw_archive.describe("datawindow.table.select")
ds_mydata.Modify("datawindow.table.select = '" + sqlSyntax + "'")
ds_mydata.Modify("datawindow.table.UpdateTable = '" + ls_tablename_archive + "'")
ds_mydata.settransobject(sqlca)
ds_mydata.retrieve()

请问我该怎样写sqlSyntax
...全文
48 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
Hanson_bati_zhu 2002-02-25
  • 打赏
  • 举报
回复
谢谢领导关怀
8-)

liulee 2002-02-24
  • 打赏
  • 举报
回复
不错~~~~
不过你也太拼命了,注意身体....
烟抽好一些的...焦油含量低一些的...

Hanson_bati_zhu 2002-02-24
  • 打赏
  • 举报
回复
总而言之

为了通用
为了MONEY

舍掉10年阳寿

8-(
Hanson_bati_zhu 2002-02-24
  • 打赏
  • 举报
回复
上面帖的程序是从我的程序中挑的最简单的一段
要是帖复杂的
估计骂我的人更多了
8-(
Hanson_bati_zhu 2002-02-24
  • 打赏
  • 举报
回复
to: llitcwl(中国龙)
没办法
8-(

客户是政府部门
牛气得很
不敢得罪
要什么就得做什么
要是不作得话。。。。。。。。
8-(

用户群很大(全国)
用户主要工作是报表的填报
用户报表样式各省、市甚至同一省内各地区都不一样(上百种样式,共数千张报表)
所以报表录入没办法简单
总不能为每一个报表做一个DW吧
而且同一个报表内还有对不同录入人员的限制、对行、列录入权限的限制等

TNND
我也不想这么麻烦啊
8-(


justlove 2002-02-24
  • 打赏
  • 举报
回复
简直是疯狂啊
llitcwl 2002-02-24
  • 打赏
  • 举报
回复
to Hanson_bati_zhu(Hanson_bati_zhu) :
高,实在高。但我还是想说:
我感觉你做的项目怎么都这么麻烦,象这样PB的代码比ASP还多。
sorrow_arrow 2002-02-24
  • 打赏
  • 举报
回复
MY GOD !
MY GOD !
NI NIU !
Hanson_bati_zhu 2002-02-24
  • 打赏
  • 举报
回复
呵呵
缩进都被CSDN干掉了
连我自己都看得发晕
8-)
Hanson_bati_zhu 2002-02-24
  • 打赏
  • 举报
回复
来一小段吧,不完整,只是局部中的局部
但应该能够看出设计思路

但愿不会挨骂

//DW语法头定义区
ls_syntax = ''
ls_syntax += '' + Char(13) + Char(10)
ls_syntax += 'release 7;' + Char(13) + Char(10)
ls_syntax += 'datawindow(units=1 color=16777215 processing=0 pointer="dw_excel.cur")' + Char(13) + Char(10)
ls_syntax += 'header(height='+String(ii_MaxLevel * 20)+' color="536870912" pointer="Arrow!")' + Char(13) + Char(10)
ls_syntax += 'summary(height=0 color="536870912" )' + Char(13) + Char(10)
ls_syntax += 'footer(height=0 color="536870912" )' + Char(13) + Char(10)
ls_syntax += 'detail(height=20 color="536870912" )' + Char(13) + Char(10)


ls_table = 'table(' + Char(13) + Char(10)
ls_retrieve = ' retrieve="SELECT '
ls_text = ''

//获取要素总数
ll_rowcount = ids_FactorInfo.RowCount()

//逐要素处理
FOR ll_index = 1 TO ll_rowcount
ids_FactorInfo.Object.FactorType[ll_index]
ls_protectset = ''
ls_visibleset = ''
ll_secufind = 0
//查找要素在安全信息记录中的位置,以便分别处理
ll_secufind = lnv_SecuInfo.ids_SecuInfo.Find("SecuID = '"+String(ids_FactorInfo.Object.FactorID[ll_index])+"'",1,ll_secucount)
//根据要塞类别分别处理
CHOOSE CASE String(ids_FactorInfo.Object.FactorType[ll_index])
CASE '001' //整数
//列实际顺序编号加一
ll_colindex ++
//根据该列对应的安全信息设置分别处理显示限制及输入限制
IF ll_secufind > 0 THEN
IF lnv_SecuInfo.ids_SecuInfo.Object.Security[ll_SecuFind] = '2' THEN //可以录入
ls_visibleset = '"1~tIF(Describe(~'t_canzeroshow.Text~') = ~'0~' AND c'+String(ll_colindex)+' = 0,0,1)"'
ls_protectset = '"0~tIF( Describe(~'t_canareaselect.Text~') = ~'0~',0,1)"'
ls_column += 'column(band=detail id='+String(ll_colindex)+' alignment="1" tabsequence='+String(ll_index * 10)+' border="0" color="0" x="0" y="2" height="19" width="'+STRING(ids_FactorInfo.Object.FactorWidth[ll_index] * 12)+'" format="[general]" protect='+ls_protectset+' name=c'+String(ll_colindex)+' visible='+ls_visibleset+' pointer="dw_excel.CUR" editmask.mask="###,###,###,##0" editmask.focusrectangle=no font.face="宋体" font.height="-9" font.weight="400" font.family="2" font.pitch="2" font.charset="134" background.mode="1" background.color="536870912" )' + Char(13) + Char(10)
ELSEIF lnv_SecuInfo.ids_SecuInfo.Object.Security[ll_SecuFind] = '1' THEN //只可看,不可修改
ls_visibleset = '"1~tIF((Describe(~'t_canzeroshow.Text~') = ~'0~') AND c'+String(ll_colindex)+' = 0,0,1)"'
ls_protectset = '"1"'
ls_column += 'column(band=detail id='+String(ll_colindex)+' alignment="1" tabsequence='+String(ll_index * 10)+' border="0" color="0" x="0" y="2" height="19" width="'+STRING(ids_FactorInfo.Object.FactorWidth[ll_index] * 12)+'" format="[general]" protect='+ls_protectset+' name=c'+String(ll_colindex)+' visible='+ls_visibleset+' pointer="dw_excel.CUR" editmask.mask="###,###,###,##0" editmask.focusrectangle=no font.face="宋体" font.height="-9" font.weight="400" font.family="2" font.pitch="2" font.charset="134" background.mode="0" background.color="536870912~tIF(Mid(select_info,'+String(ll_index + 1)+',1) = ~'1~' OR Mid(select_info,1,1) = ~'1~',RGB(205,205,235),IF(GetRow() = CurrentRow() AND Describe(~'t_canareaselect.Text~') = ~'0~',RGB(216,196,127),IF(GetRow() / 2 = INT(GetRow() / 2),RGB(255,255,255),RGB(225,225,225))))" )' + Char(13) + Char(10)
ELSE //不可见
ls_visibleset = '"0"'
ls_protectset = '"1"'
ls_column += 'column(band=detail id='+String(ll_colindex)+' alignment="1" tabsequence='+String(ll_index * 10)+' border="0" color="0" x="0" y="2" height="19" width="'+STRING(ids_FactorInfo.Object.FactorWidth[ll_index] * 12)+'" format="[general]" protect='+ls_protectset+' name=c'+String(ll_colindex)+' visible='+ls_visibleset+' pointer="dw_excel.CUR" editmask.mask="###,###,###,##0" editmask.focusrectangle=no font.face="宋体" font.height="-9" font.weight="400" font.family="2" font.pitch="2" font.charset="134" background.mode="1" background.color="536870912" )' + Char(13) + Char(10)
END IF
ELSE
ls_visibleset = '"1~tIF((Describe(~'t_canzeroshow.Text~') = ~'0~') AND c'+String(ll_colindex)+' = 0,0,1)"'
ls_protectset = '"1"'
ls_column += 'column(band=detail id='+String(ll_colindex)+' alignment="1" tabsequence='+String(ll_index * 10)+' border="0" color="0" x="0" y="2" height="19" width="'+STRING(ids_FactorInfo.Object.FactorWidth[ll_index] * 12)+'" format="[general]" protect='+ls_protectset+' name=c'+String(ll_colindex)+' visible='+ls_visibleset+' pointer="dw_excel.CUR" editmask.mask="###,###,###,##0" editmask.focusrectangle=no font.face="宋体" font.height="-9" font.weight="400" font.family="2" font.pitch="2" font.charset="134" background.mode="0" background.color="536870912~tIF(Mid(select_info,'+String(ll_index + 1)+',1) = ~'1~' OR Mid(select_info,1,1) = ~'1~',RGB(205,205,235),IF(GetRow() = CurrentRow() AND Describe(~'t_canareaselect.Text~') = ~'0~',RGB(216,196,127),IF(GetRow() / 2 = INT(GetRow() / 2),RGB(255,255,255),RGB(225,225,225))))" )' + Char(13) + Char(10)
END IF
ls_table += ' column=(type=decimal(4) updatewhereclause=yes name=c'+String(ll_colindex)+' dbname="c'+String(ll_colindex)+'" initial="0" )' + Char(13) + Char(10)
ls_retrieve +=' Sum(CASE FactorID WHEN ~''+String(ids_FactorInfo.Object.FactorID[ll_index])+'~' THEN Cnum ELSE 0 END) AS ~'c'+String(ll_colindex)+'~',' + Char(13) + Char(10)
CASE '002' //小数
llitcwl 2002-02-24
  • 打赏
  • 举报
回复
to Hanson_bati_zhu(Hanson_bati_zhu):
高!能不把代码贴出来看看?
Hanson_bati_zhu 2002-02-24
  • 打赏
  • 举报
回复
我一直是用程序整个算出DW语法的
比使用SyntaxFromSQL要灵活
llitcwl 2002-02-24
  • 打赏
  • 举报
回复
这种写法由于数据库已经创建好,实际上不是动态数据窗口,SQL语句中只能改变条件,不能改变select 子句,如果改变会提示出错。

401

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 非技术版
社区管理员
  • 非技术版社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧