帐表插件问题
金蝶云社区-mfsh416
mfsh416
1人赞赏了该文章 1,353次浏览 未经作者许可,禁止转载编辑于2013年09月25日 16:09:30

我依照SDK中树形帐表实例,改写成以下代码
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Kingdee.BOS.Contracts.Report;
using Kingdee.BOS.Core.Report.PlugIn;
using Kingdee.BOS.Core.Report;
using Kingdee.BOS.Core.Metadata;
using Kingdee.BOS.App.Data;
using Kingdee.BOS.Core.CommonFilter;
using Kingdee.BOS.Util;
namespace Kingdee.BOS.Demo.Report
{
public class DemoTreeeReport : SysReportBaseService
{
public override void Initialize()
{
// TODO:
this.ReportProperty.ReportType = Core.Report.ReportType.REPORTTYPE_TREE;
}
//protected override string SetOrderByOver(IRptParams filter, string orderBy)
//{
// return string.Format(orderBy, "fsupplierid");
//}
public override void BuilderReportSqlAndTempTable(IRptParams filter, string tableName)
{
string sSQL = "select fsupplierid as FID, fname,fdescription as fdesc,FLocaleId, {0} into {1} from t_BD_Supplier_L ";
if (((TreeRptParams)filter).CurrentGroupID != null && ((TreeRptParams)filter).CurrentGroupID.ToString() != "-1")
{
sSQL += " where FLocaleId=" + ((TreeRptParams)filter).CurrentGroupID;
}
this.KSQL_SEQ = string.Format(this.KSQL_SEQ, "FLocaleId desc");
sSQL = string.Format(sSQL, this.KSQL_SEQ, tableName);
DBUtils.Execute(this.Context, sSQL);
}
public override List GetTreeNodes(IRptParams filter)
{
List nodeList = new List();
TreeNode rootNode = new TreeNode()
{
children = new List(),
id = "2052",
text = "简体中文"
};
nodeList.Add(rootNode);
rootNode = new TreeNode()
{
children = new List(),
id = "3076",
text = "繁体中文"
};
nodeList.Add(rootNode);
rootNode = new TreeNode()
{
children = new List(),
id = "1033",
text = "英文"
};
nodeList.Add(rootNode);
return nodeList;
}
public override ReportTitles GetReportTitles(IRptParams filter)
{
ReportTitles titles = new ReportTitles();
//if (((TreeRptParams)filter).CurrentGroupID.ToString() != "-1")
//{
// titles.AddTitle("FLocaleIdTitle", ((TreeRptParams)filter).CurrentGroupID);
//}
return titles;
}
public override ReportHeader GetReportHeaders(IRptParams filter)
{
// TODO:fentryid,fid,fbaseunitqty,fmaterialid,fbomid,fqty
ReportHeader header = new ReportHeader();
//header.AddChild("FID", new LocaleValue("ID", this.Context.UserLocale.LCID));
header.AddChild("fname", new LocaleValue(Kingdee.BOS.Resource.ResManager.LoadKDString("名称", "002460030014713", Kingdee.BOS.Resource.SubSystemType.BOS), this.Context.UserLocale.LCID));
header.AddChild("fdescription", new LocaleValue(Kingdee.BOS.Resource.ResManager.LoadKDString("描述", "002460030014716", Kingdee.BOS.Resource.SubSystemType.BOS), this.Context.UserLocale.LCID), SqlStorageType.SqlDecimal);
header.AddChild("FLocaleId", new LocaleValue(Kingdee.BOS.Resource.ResManager.LoadKDString("语言", "002460030014719", Kingdee.BOS.Resource.SubSystemType.BOS), this.Context.UserLocale.LCID), SqlStorageType.SqlDecimal);

return header;
}
}
}

但是加入帐表的服务器插件中,调试弹出以下错误: