应用于:行列式,单据列式+明细内容。
如下:
效果:
1、 网页中要显示哪些标题;
2、 各标题(是否必填项提示、列宽、字体排列方式:居左、中、右;是否为可以输入)
3、 是否需要汇总当前页数据
4、 打印、导出的列内容自己定义,可以设定每个单位体都有不同的打印内容、导出内容。
作用:
1、 缩减每个文件编写代码的行数;
2、 方便维护代码:减少对源文件的修改;
3、 增加开发速度;建立一个文件模版,其它文件开始编写时先导入。重点修改差异部分。
方法:
1、 字段控制表:管理各文件中的列标题字段的设置。如:
2、 读取标题相关设置:在各个文件中先读取标题的设置然后应用。
===============================以下为单据列式+明细内容(可作明细内容,也可作非单据列式时的行列式,也即每页显示的内容就可以由以下的代码控制输出了。)
''------------------------------------------------------单据列表标题行
if cdbl(ifdifferent)=11 then
ChangeAllname="newidsh"
response.write "<table style='margin: 0 auto;width: "&TotalWidth&"px;border: 0;padding: 0;border-spacing: 0;table-layout: fixed;word-bread: break-all;' id='ces_main'>"
response.write "<tr>"
for t=lbound(SplitCol) to cdbl(ubound(SplitCol))-1
if SplitColIndex(t)<=50 then
ResultWidth=cdbl(round(cdbl(Splitwidth(t))*cdbl(WidthScreen),0))-1 ''各字段规定的宽度*总宽显示的比
if SplitMustIs(t)="True" then ''必填字段
response.write "<th style='width: "&ResultWidth&"px;text-align: "&SplitAlign(t)&";' class='alert_color'>"&SplitChCol(t)&"</th>"
else
response.write "<th style='width: "&ResultWidth&"px;text-align: "&SplitAlign(t)&";'>"&SplitChCol(t)&"</th>"
end if
end if
next
response.write "</tr>"
''--------------------------------------------------单据列表内容
''*******************************************************显示明细内容:行内容
for n=1 to cdbl(pagenum)
''******************************************************************行内容异化区间
if cdbl(ifpnum)=1 then
if rs.bof or rs.eof then exit for
Pnum=rs(FdName)
else
Pnum=n ''变量名称的后缀,默认取值
end if
''------------------------------------------行显样式中的状态变量值
if ifstates<>"" then
TrStates=rs(ifstates)
else
TrStates=0
end if
''-------------------------------------------行显示样式
TrStyle="" ''行因状态值不同而显示不同的样式
TrClick=" ondblclick='javascript:window.location.href="""&files&"?chname="&chname&"&delid="&Pnum&"&pageid="&pageid&"""' title='双击显示明细'"
if cdbl(delid)=cdbl(Pnum) then
TrStyle=" class='OkShowLineColor'"
else
if cdbl(TrStates)=-1 then
TrStyle=" class='stop_color'"
elseif cdbl(TrStates)=1 then
TrStyle=" class='yesaudit_color'"
elseif cdbl(TrStates)=2 then
TrStyle=" class='close_color'"
end if
end if
''******************************************************************行内容