冬瓜茶饮料

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

posted on 2016-10-17 16:14  冬瓜茶饮料  阅读(338)  评论(0编辑  收藏  举报

导航