BOS运行时-分页报表-干预引出excel页签名称
分页报表支持引出所有页功能(注意维度多会占用较多应用服务器和数据库服务器资源),每一个维度的数据保存到一个excel页签内,有时候需要干预这个excel页签名称。
在23年1月份及以后版本,有个单独干预的插件方法
BeforeBuildExcelSheet
在之前版本,是通过修改dataset的各个datatable名称来进行干预
AfterGetAllPageDataSet
干预后,引出效果如下:
参考代码如下:
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args; using Kingdee.BOS.Core.Metadata; using Kingdee.BOS.Core.Report.PlugIn; using Kingdee.BOS.Core.Report.PlugIn.Args; using Kingdee.BOS.Orm.DataEntity; using Kingdee.BOS.ServiceHelper; using Kingdee.BOS.Util; using Kingdee.BOS.WebApi.Client; using Kingdee.BOS.WebApi.FormService; using System; using System.Collections.Generic; using System.Collections.Specialized; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Cloud.BOS.Support.Report { [Description("分页报表干预引出的sheet名称")] [HotUpdate] public class MoveRptExportNamePlugin : AbstractSysReportPlugIn { /// <summary> /// 23年1月份标准补丁及以后版本用这个干预 /// </summary> /// <param name="e"></param> public override void BeforeBuildExcelSheet(BeforeBuildExcelSheetEventArgs e) { // e.SheetName= string.Format("自定义sheet名称{0}", e.Position); } /// <summary> /// 23年1月份标准补丁之前干预方案 /// </summary> /// <param name="e"></param> public override void AfterGetAllPageDataSet(AfterGetAllPageDataSetEventArgs e) { if(e.DS==null || e.DS.Tables==null || e.DS.Tables.Count==0) { return; } for (int i = 0; i < e.DS.Tables.Count; i++) { //修改dataTable名称,让引出名称变化 e.DS.Tables[i].TableName = string.Format("自定义sheet名称{0}", i); } } } }
BOS运行时-分页报表-干预引出excel页签名称
分页报表支持引出所有页功能(注意维度多会占用较多应用服务器和数据库服务器资源),每一个维度的数据保存到一个excel页签内,有时候需要...
点击下载文档
本文2024-09-16 18:12:43发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-20671.html
您需要登录后才可以发表评论, 登录登录 或者 注册
最新文档
热门文章