单据中单据体的字段是动态添加的,单据体如何引出动态字段
在表单插件中重写BeforeEntityExport
可参考以下示例
public override void BeforeEntityExport(BeforeEntityExportArgs e)
{
base.BeforeEntityExport(e);
e.Headers = new Dictionary<string, List<ExcelField>>();
var headers = new List<ExcelField>();
e.Headers["FEntity"] = headers;
var fieldAppearances = this.View.LayoutInfo.GetFieldAppearances();
foreach (var fieldKey in fieldKeys)
{
var field = this.View.BillBusinessInfo.GetField(fieldKey);
var type = field.GetType();
var excelField = new ExcelField
{
FieldKey = field.Key,
FieldName = field.PropertyName,
Caption = field.Name.ToString(),
ColumnType = field.GetPropertyType(),
Width = 100,
Align = type == typeof(DecimalField) || type == typeof(IntegerField) || type == typeof(AmountField) ? 1 : 0,
};
headers.Add(excelField);
}
}
单据中单据体的字段是动态添加的,单据体如何引出动态字段
本文2024-09-16 18:32:18发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-22794.html