套打数据包表体
金蝶云社区-Zw814
Zw814
1人赞赏了该文章 1,510次浏览 未经作者许可,禁止转载编辑于2016年11月01日 10:52:47

在准备打印数据包的时候,断点只走过表头,表体的走不进

public override void OnPrepareNotePrintData(Kingdee.BOS.Core.DynamicForm.PlugIn.Args.PreparePrintDataEventArgs e)
{
List lstEntryData = null;
DynamicObjectCollection docEntryData=null;
try
{
base.OnPrepareNotePrintData(e);
if (e.DataSourceId.ToUpper().Equals("FBillHead".ToUpper()))
{
var doNewHead = new DynamicObject(e.DynamicObjectType);
doNewHead["FCARNO"] = this.Model.GetValue("FCARNO"); //车牌号
doNewHead["FRECEIVER"] = this.Model.GetValue("FRECEIVER"); //收货人
e.DataObjects = new DynamicObject[] { doNewHead };
}

if (e.DataSourceId.ToUpper().Equals("FEntity".ToUpper()))
{
lstEntryData = new List();
docEntryData=this.Model.DataObject["BC_LOADPRINTENTRY"] as DynamicObjectCollection;
foreach (DynamicObject doValue in docEntryData)
{
var doNewEntryRow = new DynamicObject(e.DynamicObjectType);

doNewEntryRow["FMATERIALID_FNumber"] = doValue["FMATERIALID"]; //物料编码
doNewEntryRow["FMATERIALID_FName"] = doValue["FMATERIALNAME"]; //物料名称
doNewEntryRow["FUNITID_FName"] = doValue["FUNITID"]; //单位
doNewEntryRow["FQTY"] = doValue["FQTY"]; //数量
lstEntryData.Add(doNewEntryRow);
}
e.DataObjects = lstEntryData.ToArray();
}
}