场景
金蝶云星空系统,表单单据体或者单据列表宽度可以自由拖拽,但是行高却无法设置。本文提供设置的示例代码和教程。
代码
1. 单据列表行高设置
设置度为80后效果图
推荐使用Python代码,最后一行高值可随时调整。
import clr
clr.AddReference('System')
clr.AddReference('Kingdee.BOS.Core')
from Kingdee.BOS.Core.DynamicForm import *
from Kingdee.BOS.JSON import *
def OnLoad(e):
this.View.GetControl("FLIST").SetRowHeight(80);
clr.AddReference('System')
clr.AddReference('Kingdee.BOS.Core')
from Kingdee.BOS.Core.DynamicForm import *
from Kingdee.BOS.JSON import *
def OnLoad(e):
this.View.GetControl("FLIST").SetRowHeight(80);
设置步骤:打开要设置的单据后,添加列表插件,注册Python脚本。
C#插件设置代码(修改麻烦不推荐)
public class TestrowHeigth : AbstractListPlugIn
{
public override void OnLoad(EventArgs e) {
this.View.GetControl("FLIST").SetRowHeight(80);
base.OnLoad(e);
}
}
{
public override void OnLoad(EventArgs e) {
this.View.GetControl("FLIST").SetRowHeight(80);
base.OnLoad(e);
}
}
2. 单据体行高设置
参考以上方法,如下代码注册为表单插件即可。
Python表单插件代码:
import clr
clr.AddReference('System')
clr.AddReference('Kingdee.BOS.Core')
from Kingdee.BOS.Core.DynamicForm import *
from Kingdee.BOS.JSON import *
def AfterBindData(e):
this.View.GetControl("FEntity").SetRowHeight(80);
clr.AddReference('System')
clr.AddReference('Kingdee.BOS.Core')
from Kingdee.BOS.Core.DynamicForm import *
from Kingdee.BOS.JSON import *
def AfterBindData(e):
this.View.GetControl("FEntity").SetRowHeight(80);
C#表单插件代码:
public class TestrowHeigth : AbstractDynamicFormPlugIn
{
public override void AfterBindData(EventArgs e){
this.View.GetControl("FEntity").SetRowHeight(80);
base.AfterBindData(e);
}
}
{
public override void AfterBindData(EventArgs e){
this.View.GetControl("FEntity").SetRowHeight(80);
base.AfterBindData(e);
}
}
暂无评论