57.2、报表插件,透视表原创
金蝶云社区-林荫大道cc身份
林荫大道cc
12人赞赏了该文章 4989次浏览 未经作者许可,禁止转载编辑于2020年07月16日 08:18:29
封面

57.1



和 上一节 55.2 操作类似




1、添加类 TSPOOrderDetailt3


2、引用,使用,继承和上一节一样


3、复制 53.3的代码


image.png



4、初始化


        //初始化
        
        public override void Initialize()
        {
            //是否分组汇总
            this.ReportProperty.IsGroupSummary = true;
            
            base.ReportProperty.ReportName = new LocaleValue("透视报表");
            
            base.Initialize();
        }


image.png



5、获取组织名称,基础资料名称 和上一节一致


image.png



7、修改 临时表


            base.SettingInfo = new PivotReportSettingInfo();


image.png



7.1、标题


SettingField field1 = PivotReportSettingInfo.CreateColumnSettingField(new TextField()
            {
                Key = "FOrgname",
                FieldName = "FOrgname",
                Name = new LocaleValue("组织")
            },0);
            base.SettingInfo.RowTitleFields.Add(field1);
            base.SettingInfo.SelectedFields.Add(field1);


image.png



            SettingField field2 = PivotReportSettingInfo.CreateColumnSettingField(new TextField()
            {
                Key = "FSuppName",
                FieldName = "FSuppName",
                Name = new LocaleValue("供应商")
            }, 0);
            field2.SumType = 0;
            base.SettingInfo.AggregateFields.Add(field2);
            base.SettingInfo.SelectedFields.Add(field2);


image.png



            SettingField field3 = PivotReportSettingInfo.CreateColumnSettingField(new DecimalField()
             {
                 Key = "FALLAMOUNT",
                 FieldName = "FALLAMOUNT",
                 Name = new LocaleValue("金额")
             }, 0);
            field3.SumType = 1;
            base.SettingInfo.AggregateFields.Add(field3);
            base.SettingInfo.SelectedFields.Add(field3);


image.png



            SettingField field4 = PivotReportSettingInfo.CreateColumnSettingField(new DateField()
             {
                 Key = "FDate",
                 FieldName = "FDate",
                 Name = new LocaleValue("订单日期")
             }, 0);
            base.SettingInfo.ColTitleFields.Add(field4);
            base.SettingInfo.SelectedFields.Add(field4);


image.png



8、后面和上一节代码一样,具体请参考附件代码


8.1、请参考最后面附件WORD,红书部分是在上一节简单账表上做的修改;


9、注册插件



10、最终效果,打开报表,可以拖动 横纵标题


image.png


总目录链接

https://vip.kingdee.com/article/6499387201459123

透视表.docx(42.06KB)

57.2.zip(53.66KB)

赞 12