zoukankan      html  css  js  c++  java
  • Using query Statistics total record of Row on the Form

    Sometimes customer want to know how many records in that Form.(include user query or filter condition) .

    Well.Such as below X++ Code:

    Wrote by Jimmy on April 21th on 2011

    display int64 recCount()
    {
    //this method maybe replace under the datasource method(must be specify datasource) or Form method
        QueryRun                qrCount;
        QueryBuildDataSource    qbsCount;
        DictTable               dictTable;
        DictField               dictField;
        int64                   rowCount;
        Common                  common;
    ;
        //qrCount     = new QueryRun(this.queryRun().query().pack());//datasource method
        qrCount     = new QueryRun(QVS_POJournalTable_ds.queryRun().query().pack());//Form method or datasource method
        qbsCount    = qrCount.query().dataSourceNo(1);
        dictTable   = new DictTable(qbsCount.table());
    
        qbsCount.orderMode(orderMode::GroupBy);
        qbsCount.addSelectionField(dictTable.fieldName2Id("RecId"),SelectionField::Count);
        //..... add table relation and one of filtering field
    
        while (qrCount.next())
        {
            common   = qrCount.getNo(1);
            rowCount = any2int(common.RecId);
        }
    
        return rowCount;
    }
    
  • 相关阅读:
    计算机英语
    NSQ学习记录
    Java学习记录-注解
    VS插件开发

    双链表
    顺序表
    顺序队列
    顺序栈

  • 原文地址:https://www.cnblogs.com/Fandyx/p/2023559.html
Copyright © 2011-2022 走看看