wincc 内哪些控件可以用来显示sql的数据表格?
郑志武
发布于2013-10-21 00:50
2
0
标签:
wincc内有哪些控件可以用来显示sql的数据表格?
问题补充:
不是wincc自带的sql
佳答案
很多控件都可以,如果自己写脚本,像text,listbox,msflexgrid,combobox都可以,主要看你数据显示格式了,好就用msflexgrid1控件了,给你一个控件使用的例子:
dimstr1
pt=app.path
t=pt&"ms.txt"
opentforinputas#1'打开文件
if(lof(1)>0)then
dowhilenoteof(1)
lineinput#1,str1'存放
loop
endif
close#1'关闭文件
dimstr2asstring
str2="字段一|字段二|字段三|字段四"
msflexgrid1.allowuserresizing=1
msflexgrid1.fixedrows=1
msflexgrid1.fixedcols=0
msflexgrid1.formatstring=str2
msflexgrid1.colwidth(0)=1600
msflexgrid1.colwidth(1)=2300
msflexgrid1.colwidth(2)=2300
msflexgrid1.colwidth(3)=1600
msflexgrid1.rows=1
msflexgrid1.cols=4
s=split(str1,"")
msflexgrid1.additem(s(0)&vbtab&s(1)&vbtab&s(2)&vbtab&s(3))