博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
【转】【金蝶K3Cloud】 分页账表
阅读量:5281 次
发布时间:2019-06-14

本文共 4881 字,大约阅读时间需要 16 分钟。

1 using System;  2 using System.Collections.Generic;  3 using System.Linq;  4 using System.Text;  5 using System.Threading.Tasks;  6 using System.ComponentModel;  7 using Kingdee.BOS.Contracts;  8 using Kingdee.BOS.Contracts.Report;  9 using Kingdee.BOS.Core.Metadata; 10 using Kingdee.BOS.Core.Report; 11 using Kingdee.BOS.App.Data; 12 using Kingdee.BOS.Core.Permission.Objects; 13 using Kingdee.K3.SCM.App.Sal.Report; 14 using Kingdee.BOS.Resource; 15 using Kingdee.BOS.BusinessEntity.BusinessFlow; 16 using Kingdee.BOS.Util; 17 using Kingdee.BOS.Orm.DataEntity; 18 using Kingdee.BOS.Core.Report.PlugIn; 19 using System.Data; 20 using Kingdee.BOS; 21  22  23 namespace MySysReportServicePluginThreeMxz 24 { 25     [Description("分表mxz练习-服务插件")] 26     public class MyPageReportTabserPluginmxz : SysReportBaseService 27     { 28         public override void Initialize() 29         { 30             this.ReportProperty.ReportType = ReportType.REPORTTYPE_MOVE;//设置为分页账表 31             this.ReportProperty.IsGroupSummary = true;//支持分组汇总 32         } 33  34         ///  35         /// 动态构造列 36         ///  37         ///  38         /// 
39 public override ReportHeader GetReportHeaders(IRptParams filter) 40 { 41 ReportHeader header = new ReportHeader(); 42 header.AddChild("FID", new LocaleValue(Kingdee.BOS.Resource.ResManager.LoadKDString("编码", "002460030014674", Kingdee.BOS.Resource.SubSystemType.BOS), this.Context.UserLocale.LCID)); 43 header.AddChild("fname", new LocaleValue(Kingdee.BOS.Resource.ResManager.LoadKDString("全名", "002460030014677", Kingdee.BOS.Resource.SubSystemType.BOS), this.Context.UserLocale.LCID)); 44 header.AddChild("fdesc", new LocaleValue(Kingdee.BOS.Resource.ResManager.LoadKDString("别名", "002460030014680", Kingdee.BOS.Resource.SubSystemType.BOS), this.Context.UserLocale.LCID)); 45 header.AddChild("FLocaleId", new LocaleValue(Kingdee.BOS.Resource.ResManager.LoadKDString("类别", "002460030014683", Kingdee.BOS.Resource.SubSystemType.BOS), this.Context.UserLocale.LCID), SqlStorageType.SqlInt); 46 return header; 47 } 48 49 /// 50 /// 设置报表头 51 /// 52 /// 53 ///
54 public override ReportTitles GetReportTitles(IRptParams filter) 55 { 56 ReportTitles titles = new ReportTitles(); 57 if(CacheDataList != null) 58 { 59 DataTable dt = GetList(filter); 60 if (dt != null && dt.Rows.Count > 0) 61 { 62 //titles.AddTitle("FCondition", dt.Rows[0]["flocaleid"].ToString()); 63 return titles; 64 } 65 return null; 66 } 67 DataRow dr = this.CacheDataList[filter.CurrentPosition]; 68 //titles.AddTitle("FCondition", dr["flocaleid"].ToString()); 69 return titles; 70 } 71 72 /// 73 /// 构造取数Sql,取数据填充到临时表:tableName 74 /// 75 /// 76 /// 77 public override void BuilderReportSqlAndTempTable(IRptParams filter, string tableName) 78 { 79 base.BuilderReportSqlAndTempTable(filter, tableName); 80 DataRow dr = this.CacheDataList[filter.CurrentPosition]; 81 string sSQL = @"select a.fdeptid as FID, fname,ffullname as fdesc,FLocaleId,'BD_DEPARTMENT' as fformid, {0} into {1} from T_BD_DEPARTMENT a inner join T_BD_DEPARTMENT_l b on a.fdeptid=b.fdeptid where b.FLocaleId=" + dr["FLocaleId"].ToString(); 82 KSQL_SEQ = string.Format(KSQL_SEQ, "b.FLocaleId"); 83 sSQL = string.Format(sSQL, this.KSQL_SEQ, tableName); 84 DBUtils.Execute(this.Context, sSQL); 85 //DynamicObject dynamicObject = filter.FilterParameter.CustomFilter;//获取快捷页签的过滤字段数据 86 } 87 88 /// 89 /// 设置汇总行,只有显示财务信息时才需要汇总 90 /// 91 /// 92 ///
93 public override List
GetSummaryColumnInfo(IRptParams filter) 94 { 95 List
fls = new List
(); 96 SummaryField fs = new SummaryField("FLocaleId", Kingdee.BOS.Core.Enums.BOSEnums.Enu_SummaryType.SUM); 97 fls.Add(fs); 98 return fls; 99 }100 ///
101 /// 分页账表获取分页条件的方法102 /// 103 ///
104 ///
105 public override DataTable GetList(IRptParams filter)106 {107 DataTable dt;108 string sSQL = @"select FLocaleId from T_BD_DEPARTMENT_L group by FLocaleId";109 dt = DBUtils.ExecuteDataSet(this.Context, sSQL).Tables[0];110 return dt;111 }112 }113 }
View Code

 

转载于:https://www.cnblogs.com/jlz-s/p/9830053.html

你可能感兴趣的文章
工作中收集JSCRIPT代码之(下拉框篇)
查看>>
《转载》POI导出excel日期格式
查看>>
code异常处理
查看>>
git - 搭建最简单的git server
查看>>
会话控制
查看>>
推荐一款UI设计软件Balsamiq Mockups
查看>>
Linux crontab 命令格式与详细例子
查看>>
百度地图Api进阶教程-地图鼠标左右键操作实例和鼠标样式6.html
查看>>
游标使用
查看>>
LLBL Gen Pro 设计器使用指南
查看>>
SetCapture() & ReleaseCapture() 捕获窗口外的【松开左键事件】: WM_LBUTTONUP
查看>>
Android 设置界面的圆角选项
查看>>
百度地图api服务端根据经纬度得到地址
查看>>
CSS中隐藏内容的3种方法及属性值
查看>>
每天一个linux命令(1):ls命令
查看>>
根据xml生成相应的对象类
查看>>
查看ASP.NET : ViewState
查看>>
Android StageFrightMediaScanner源码解析
查看>>
vue项目中开启Eslint碰到的一些问题及其规范
查看>>
循环队列实现
查看>>