Form引用问题
链接维护: 单据类型BE - UI
在需要链接维护的页面文字上选择属性---Form引用找到单据类型UI
“UFSoft.UBF.Eventing.EventBroker” 的类型初始化值设定项引发异常?
重启IIS
页面上文字不显示:重启iis , 执行页面相关的sql和相对应的code文件下的项目批处理
怎么使用打印模板:
UIModelActionExtends.cs里添加扩展打印事件
获取打印数据:GetPrintData()
在表头或者表尾添加自定义字段的方法是:表达式方式 oql --- fx
在明细区添加自定义字段的方法是:在左侧的字段下右键添加自定义字段,然后拖到明细区
点击打印时:提示未将对象引用设置到对象的实例?
打开对应界面UI的解决方案按照下面写三段代码,以获取数据
private void PrintClick_Extend(object sender, UIActionEventArgs e)
{
IExportSettings settings = ExportServiceFactory.GetInstance().CreateExportSettingsObject();
settings.PrintTemplateCatalogType = "UFIDA.U9.Cust.OrderBill";
settings.UserDataCallBack = new DataCallBackHandle(this.GetPrintData);
e.Tag = settings;
this.PrintClick_DefaultImpl(sender, e);
}
public void GetPrintData(object sender, DataCallBackEventArgs args)
{
DataSet returnDataSet = null;
switch (args.PrintTemplateID)
{
//订货单打印
case "e6311caa-8c7f-4ec8-a174-e745da065033":
{
returnDataSet = this.GetOrderDocData();
}
break;
default:
break;
}
args.ReturnData = returnDataSet;
}
private DataSet GetOrderDocData()
{
DataSet returnDataSet = new DataSet();
DataTable tableTest = new DataTable();
tableTest.Columns.Add("MyOrderBill_DocNo");
tableTest.Columns.Add("MyOrderBill_Department_Name");
tableTest.Columns.Add("MyOrderBill_HandlingPeople_Name");
tableTest.Columns.Add("MyOrderBill_MyOrderBillBody_Number");
tableTest.Columns.Add("MyOrderBill_MyOrderBillBody_TaxPrice");
tableTest.Columns.Add("MyOrderBill_MyOrderBillBody_TaxAmount");
tableTest.Columns.Add("MyOrderBill_MyOrderBillBody_JDate");
tableTest.Columns.Add("MyOrderBill_MyOrderBillBody_MaterialGoods_MCode");
tableTest.Columns.Add("MyOrderBill_MyOrderBillBody_MaterialGoods_MName");
tableTest.Columns.Add("MyOrderBill_MyOrderBillBody_Customer_Name");
MyOrderBillRecord header = this.CurrentModel.MyOrderBill.FocusedRecord;
foreach (MyOrderBill_MyOrderBillBodyRecord record in this.CurrentModel.MyOrderBill_MyOrderBillBody.Records)
{
DataRow row = tableTest.NewRow();
row["MyOrderBill_DocNo"] = header.DocNo;
row["MyOrderBill_Department_Name"] = header.Department_Name;
row["MyOrderBill_HandlingPeople_Name"] = header.HandlingPeople_Name;
row["MyOrderBill_MyOrderBillBody_Number"] = record.Number;
row["MyOrderBill_MyOrderBillBody_TaxPrice"] = record.TaxPrice;
row["MyOrderBill_MyOrderBillBody_TaxAmount"] = record.TaxAmount;
row["MyOrderBill_MyOrderBillBody_JDate"] = record.JDate;
row["MyOrderBill_MyOrderBillBody_MaterialGoods_MCode"] = record.MCode;
row["MyOrderBill_MyOrderBillBody_MaterialGoods_MName"] = record.MName;
row["MyOrderBill_MyOrderBillBody_Customer_Name"] = record.Customer_Name;
tableTest.Rows.Add(row);
}
returnDataSet.Tables.Add(tableTest);
return returnDataSet;
}
打印模板实体key不记得了但要写上述代码,如何查看?
报表--打印模板原类型--在左侧选择最父级文件夹--右侧选择内容--找到自己要查看的模板所在的文件夹双击即可查看实体key了
UFIDA.U9.Cust.OrderBill
点击打印出来的pdf无数据:
1、以附加进程式调试代码,如果GetOrderDocData()方法里的dataset有没有值
2、GetOrderDocData()方法里的列名必须和打印模板里要显示的列的列名一致;
查看列名方法:选择字段,任选其一字段右键扩展属性,找到右侧表头过滤参照条件里面的值就是完整列名
错误 3 “MyOrderBillBE.MyOrderBill”不实现继承的抽象成员“UFIDA.U9.Base.Doc.Doc.DocType.get” D:/UFIDA/Unconfiged/Code/MyOrderBillBE/Entity/UFIDA.U9.Cust.MyOrderBillBE/MyOrderBillExtend.cs 14 23 UFIDA.U9.Cust.MyOrderBillBE
public override UFIDA.U9.Base.Doc.DocType DocType
{
get { return this.BillType ; } //返回单据类型实体
}
单据时
[System.NullReferenceException : 未将对象引用设置到对象的实例。]
原因可能是model里的属性已经更新,需要重新绑定form里的属性
组织不能为空 ?
把OnSetDefaultValue()方法放到对应实体BE里*Extend类里,用ctrl+f 查找OnSetDefaultValue()方法
/// <summary>
/// 设置默认值
/// </summary>
protected override void OnSetDefaultValue()
{
base.OnSetDefaultValue();
//组织默认为当前组织
if(this.Org==null)
this.Org = UFIDA.U9.Base.Context.LoginOrg;
}
点击“打印”能弹出“打印-网页对话框”但找不到模板:问题可有2种情况:
1、代码中的实体key写错了: settings.PrintTemplateCatalogType = "UFIDA.U9.Cust.OrderBill";
2、当前打印模板标示符ID写错了: e6311caa-8c7f-4ec8-a174-e745da065033
点击“打印”能弹出“打印-网页对话框”进行设置纸张已经选择模板等,但继续点击确定还是回到“打印-网页对话框”
原因:
this.PrintClick_DefaultImpl(sender,e); 方法写重复了。
打印模板列名修改:直接在表格里更改无效,必须在数据里更改显示名称之后再重构表格列名