报表打印多张的方法示例

来源:互联网 发布:linux cp和mv 编辑:程序博客网 时间:2024/04/29 04:47

init方法参考:

 

 public void init()
 {

    Object           caller;
    ;

    super();

    caller=element.args().caller();

    if(classidget(caller) == classnum(EajSilverEditonProductionClass))
    {
        prodTables=caller.parmProdTable();
        if(prodTables.dataSource()){
            fdsProdTable=prodTables.dataSource();
        }
    }
}

 

 

 

fetch方法示例:

 


public boolean fetch()
{

    boolean ret;


    //QueryRun curQueryRun;
    int i,j,m,n;
    ;

    for (prodTables = fdsProdTable.getFirst(true) ? fdsProdTable.getFirst(true): fdsProdTable.cursor();
                      prodTables; prodTables = fdsProdTable.getNext())
    {
         m++;
    }
    element.printJobSettings().suppressScalingMessage(true);

    for (prodTables = fdsProdTable.getFirst(true) ? fdsProdTable.getFirst(true): fdsProdTable.cursor();
                      prodTables; prodTables = fdsProdTable.getNext())
    {

            n++;
            j=0;
            element.execute(1);//print ProdOrder
            element.execute(2);

            //print bomBody
            while select prodBom index hint NumIdx
                        where prodBom.BOMId == prodTables.BOMId
            {
                j++;
                element.execute(3);//print bom item
            }
            if(j<13)
            {

              for(i=1;i<=13-j;i+=1)//print blank item
              {
                   element.execute(4);
              }
           }

           element.execute(5);
           element.execute(7);//print editionAndProcessTitle Item
           element.execute(10);
           element.execute(12);

           if(n!=m)
           {
                 element.reset();
           }

    }
    ret = true;

    return ret;

}

 

 

class方法:

   返回ID参考方法:

 

 public str parmConProdId(ProdId _conProdId = prodId)
{
    ;
    if (_conProdId)
    {
        if (prodId)
            prodId += ',' + _conProdId;
        else
            prodId = _conProdId;
    }

    return prodId;
}

 

返回Table方法示例:

ProdTable parmProdTable(ProdTable   _prodTable = prodTable)
{
    ;
    prodTable=_prodTable;

    return prodTable;
}

 

unpack()方法:

public boolean unpack(container packedClass)
{
    boolean ret;

    ret = super(packedClass);

    return ret;
}

 

启动main()方法:

public static void main(Args _args)
{
    EajSilverEditonProductionClass eajSilverEditonProductionClass = new EajSilverEditonProductionClass();


    ;

    if (!_args || !_args.record() || _args.dataset() != tablenum(ProdTable))
    {
        info("Please chose printed record to print ","",null);

        return ;
    }


    if(eajSilverEditonProductionClass.prompt()){
           eajSilverEditonProductionClass.parmProdTable(_args.record());
           eajSilverEditonProductionClass.run();
    }
}

 

原创粉丝点击