动态表单打印报错:未实现该方法或操作
金蝶云社区-Tony
Tony
0人赞赏了该文章 1,052次浏览 未经作者许可,禁止转载编辑于2018年03月15日 16:42:10

cloud7.1
自己搭了一个动态表单,上面有一个打印菜单按钮,配了标准的打印操作,数据通过插件实现,关键代码如下:
[code]public override void OnPrepareNotePrintData(Kingdee.BOS.Core.DynamicForm.PlugIn.Args.PreparePrintDataEventArgs e)
{
if (e.DataSourceId.Equals("FBillHead", StringComparison.OrdinalIgnoreCase))
{
// 基于套打要求的ORM数据模型,构建数据包,取单据头的字段值
// 特别注意:e.DynamicObjectType,仅包含了套打会用到的单据头字段
DynamicObject notePrintHeadObj = new DynamicObject(e.DynamicObjectType);
// 为字段赋值:本例仅演示给单据编号赋值
notePrintHeadObj["FCS"] = this.Model.GetValue("FCS");
e.DataObjects = new DynamicObject[] { notePrintHeadObj };
}

if (e.DataSourceId.Equals("FEntity", StringComparison.OrdinalIgnoreCase))
{
DynamicObjectCollection entity = this.View.Model.DataObject["FEntity"] as DynamicObjectCollection;

List notePrintEntryRows = new List();
foreach (var row in entity)
{
DynamicObject notePrintEntryRow = new DynamicObject(e.DynamicObjectType);
notePrintEntryRow["FEntity_FSeq"] = row["Seq"];
notePrintEntryRow["FText"] = row["FText"];
notePrintEntryRows.Add(notePrintEntryRow);
}
e.DataObjects = notePrintEntryRows.ToArray();
}

base.OnPrepareNotePrintData(e);
}[/code]预览出来没问题,然后在预览界面点打印就报下面的错误

点确定后,能跳出打印机选择,也能打印。
就是跳出这个提示不知道是什么问题,问问各位

您的鼓励与嘉奖将成为创作者们前进的动力,如果觉得本文还不错,可以给予作者创作打赏哦!

请选择打赏金币数 *

10金币20金币30金币40金币50金币60金币
可用金币: 0