NC nc5.x报表设置合计行是否显示

首先要先继承UI类

/**
     * 设置合计行是否显示
     */
    public TotalsReportUI() {
        super();
        getReportBase().getBodyPanel().setTotalRowShow(true);
        // 设置需要合计栏
        setTotalItems();
    }
private void setTotalItems() {
        BillItem[] reportItems = getReportBase().getBillModel().getBodyItems();
        if (reportItems == null || reportItems.length == 0)
            return;
        String itemKey = null;
        for (BillItem reportItem : reportItems) {
            if (reportItem == null)
                continue;
            itemKey = reportItem.getKey() == null ? "" : reportItem.getKey();
            if (itemKey.contains("nrevmny") || itemKey.contains("nrevlfmny")
                    || itemKey.contains("nmny") || itemKey.contains("invmny")
                    || itemKey.contains("pjmny") || itemKey.contains("invnum")
                    || itemKey.contains("pjnum")) {
                reportItem.setTatol(true);
            }
        }
    }

将需要合计的列值名 ,set给itemKey

nc.ui.pub.bill.BillScrollPane


作者:冬瓜茶饮料
出处:http://www.cnblogs.com/dongguacha/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

原文地址:https://www.cnblogs.com/dongguacha/p/5970174.html