Excel打印.二开案例.表单插件调用excel打印

栏目:云星空知识作者:金蝶来源:金蝶云社区发布:2024-09-16浏览:1

Excel打印.二开案例.表单插件调用excel打印

【场景】插件调用excel打印 【案例】调用采购订单的excel打印,指定模板的预览 <1>数据库获取excel模板的内码 ```sql select * from t_bos_excelprint --fbillformid,业务对象标识 ``` ![1667546683277.webp](/download/0100699d55c534b34095b61cc9440e9c1986.webp) <2>表单插件案例 ```csharp using Kingdee.BOS.Core; using Kingdee.BOS.Core.Bill.PlugIn; using Kingdee.BOS.Core.DynamicForm.PlugIn.Args; using Kingdee.BOS.JSON; using Kingdee.BOS.ServiceHelper.ExcelPrint; using System; using System.Collections.Generic; namespace DynamicFormPlugIn.NotePrint { [Kingdee.BOS.Util.HotUpdate] public class TestExcelPrintPlugIn : AbstractBillPlugIn { public override void BarItemClick(BarItemClickEventArgs e) { base.BarItemClick(e); if (!string.Equals(e.BarItemKey, "tb_Text_ExcelPrint", StringComparison.OrdinalIgnoreCase)) return; object pkVal = this.View.Model.GetPKValue(); if (pkVal == null) return; //模板单据内码集合 Dictionary<string, List<string>> tempBillDict = new Dictionary<string, List<string>>(); tempBillDict["3680011a-f62a-4d2a-a23d-b368bd080116"] = new List<string>() { pkVal.ToString() }; JSONObject jsonObject = new JSONObject(); jsonObject.Add("Data",tempBillDict); jsonObject.Add("JSONObject", null);//自定义参数 LoginExcelPrintParam loginParam = new LoginExcelPrintParam(); loginParam.ActionType = Kingdee.BOS.Core.NotePrint.ExcelPrintAction.Preview; loginParam.FormId = this.View.BillBusinessInfo.GetForm().Id; loginParam.PageId = this.View.PageId; loginParam.ActionNumber = this.GetType().Name; loginParam.PrintParam = jsonObject; ExcelPrintServiceHelper.SendExcelPrintAction(View, loginParam); } } } ``` 【效果】自动弹出预览窗

Excel打印.二开案例.表单插件调用excel打印

【场景】插件调用excel打印【案例】调用采购订单的excel打印,指定模板的预览<1>数据库获取excel模板的内码```sqlselect * from t_bos_e...
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息