尝试过把单据体中的每一行数据装载到 e.DataObjects里面,但是报错,索引超出范围
代码示例:
public override void OnPrepareNotePrintData(Kingdee.BOS.Core.DynamicForm.PlugIn.Args.PreparePrintDataEventArgs e)
{
List
var barcodeobj = new DynamicObject(e.DynamicObjectType);
//构建新数据包并提供给系统
if (e.DataSourceId.Equals("FBillHead", StringComparison.OrdinalIgnoreCase))
{
}
//构建新数据包并提供给系统
if (e.DataSourceId.Equals("FEntity", StringComparison.OrdinalIgnoreCase))
{
DynamicObjectCollection entrys = this.View.Model.DataObject["LQ_Kf0a31a9b"] as DynamicObjectCollection;
foreach (object entry in entrys)
{
//赋值
dataPackage.Add(barcodeobj);
}
e.DataObjects = dataPackage.ToArray();//新数据包;
e.DynamicObjectType = barcodeobj.DynamicObjectType;//新数据包的DynamicObjectType;
}
base.OnPrepareNotePrintData(e);
}
推荐阅读