【转】【金蝶K3Cloud】 树形账表
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.ComponentModel; using System.ServiceModel; using System.Threading.Tasks; using System.Data; using System.Collections; using Kingdee.BOS.Contracts; using Kingdee.BOS.Contracts.Report; using Kingdee.BOS.Core.Metadata; using Kingdee.BOS.Core.Report; using Kingdee.BOS.Core.DynamicForm; using Kingdee.BOS.Core.DynamicForm.Operation; using Kingdee.BOS.Core.DynamicForm.PlugIn; using Kingdee.BOS.Core.DynamicForm.PlugIn.Args; using Kingdee.BOS.Util; using Kingdee.BOS.Core.DynamicService; using Kingdee.BOS.App.Data; using Kingdee.BOS.Orm.DataEntity; using Kingdee.K3.SCM.Sal.Report.PlugIn; using Kingdee.BOS.Core.SqlBuilder; using Kingdee.BOS.Core.Permission; using Kingdee.BOS.App.Core.BusinessFlow; using Kingdee.BOS.Core.BusinessFlow.ServiceArgs; using Kingdee.BOS.BusinessEntity.BusinessFlow; using Kingdee.BOS.Core.Permission.Objects; using Kingdee.K3.SCM.App.Sal.Report; using Kingdee.BOS.Resource; using Kingdee.BOS.Core.Metadata.FormElement; using Kingdee.BOS; using Kingdee.BOS.Core.List; using Kingdee.BOS.Core; using Kingdee.BOS.Core.Util; using Kingdee.K3.Core; namespace MySysReportServicePluginThreeMxz { [Description("树表mxz练习-服务插件")] public class MyTreeReportTabserPluginmxz : SysReportBaseService { public override void Initialize() { this.ReportProperty.ReportType = ReportType.REPORTTYPE_TREE;//设置类型为树形账表 } /// <summary> /// 动态构造列 /// </summary> /// <param name="filter"></param> /// <returns></returns> 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("FLocaleId", new LocaleValue(Kingdee.BOS.Resource.ResManager.LoadKDString("语言", "002460030014719", Kingdee.BOS.Resource.SubSystemType.BOS), this.Context.UserLocale.LCID), SqlStorageType.SqlDecimal); header.AddChild("fdescription", new LocaleValue(Kingdee.BOS.Resource.ResManager.LoadKDString("描述", "002460030014716", Kingdee.BOS.Resource.SubSystemType.BOS), this.Context.UserLocale.LCID), SqlStorageType.SqlDecimal); return header; } /// <summary> /// 构造取数Sql,取数据填充到临时表:tableName /// </summary> /// <param name="filter"></param> /// <param name="tableName"></param> public override void BuilderReportSqlAndTempTable(IRptParams filter, string tableName) { base.BuilderReportSqlAndTempTable(filter, 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<Kingdee.BOS.Core.Metadata.TreeNode> GetTreeNodes(IRptParams filter) { List<TreeNode> nodeList = new List<TreeNode>(); TreeNode rootNode = new TreeNode() { children = new List<TreeNode>(), id = "2052", text = Kingdee.BOS.Resource.ResManager.LoadKDString("JAVA", "002460030014704", Kingdee.BOS.Resource.SubSystemType.BOS) }; nodeList.Add(rootNode); rootNode = new TreeNode() { children = new List<TreeNode>(), id = "2052", text = Kingdee.BOS.Resource.ResManager.LoadKDString("PYTHON", "002460030014707", Kingdee.BOS.Resource.SubSystemType.BOS) }; nodeList.Add(rootNode); rootNode = new TreeNode() { children = new List<TreeNode>(), id = "2052", text = Kingdee.BOS.Resource.ResManager.LoadKDString("C#", "002460030014710", Kingdee.BOS.Resource.SubSystemType.BOS) }; nodeList.Add(rootNode); return nodeList; } /// <summary> /// 设置报表头 /// </summary> /// <param name="filter"></param> /// <returns></returns> public override ReportTitles GetReportTitles(IRptParams filter) { ReportTitles titles = new ReportTitles(); return titles; } /// <summary> /// 设置汇总行,只有显示财务信息时才需要汇总 /// </summary> /// <param name="filter"></param> /// <returns></returns> public override List<SummaryField> GetSummaryColumnInfo(IRptParams filter) { List<SummaryField> summaryList = new List<SummaryField>(); return summaryList; } } }