zoukankan      html  css  js  c++  java
  • Using to X++ code create and running report

    X++ Code below as:

    Wrote by Jimmy on DEC.3th 2010

    Usinmg X++ Code Created report
    static void Jimmy_ReportCodeCreatedRun(Args _args)
    {
    #AOT
    Report areport;
    ReportDesign design;
    ReportAutoDesignSpecs specs;
    ReportSection section;
    ReportRun ReportRun;
    str reportName
    = "CodeAutoCreatReport";
    tableid custTableId
    = tablenum(CustTable);
    TreeNode reportNode
    = TreeNode::findNode(#ReportsPath);
    ;
    // Delete the report if it already exists
    areport = reportNode.AOTfindChild(reportName);
    if (areport)
    areport.AOTdelete();

    // Build the report
    areport = reportNode.AOTadd(reportName);
    //Add datasource for report
    areport.query().addDataSource(custTableId);

    //set up Design
    design = areport.addDesign('Design');
    design.reportTemplate(
    "InternalList");
    design.caption(tableid2PName(tablenum(CustTable)));

    specs
    = design.autoDesignSpecs();
    section
    = specs.addSection(ReportBlockType::Body, custTableId);
    section.addControl(custTableId, fieldnum(CustTable, AccountNum));
    section.addControl(custTableId, fieldnum(CustTable, Name));

    // Now the report will not prompt for user input
    areport.interactive(false);
    areport.query().interactive(
    false);
    areport.AOTcompile();

    ReportRun
    = ClassFactory.reportRunClass(new Args(reportName));

    ReportRun.init();
    ReportRun.printJobSettings().suppressScalingMessage(
    true);//removed Scaling Message
    ReportRun.run();
    }
  • 相关阅读:
    Python实现栈、队列、双端队列
    Redis主从配置、数据持久化、集群
    Redis安装,数据类型及常用命令
    nginx+uwsgi环境部署
    Nginx负载均衡、location匹配
    Nginx安装、多域名访问
    Linux-mysql的备份与恢复
    Linux-mysql主从复制
    Python dumps()的使用
    Python rpush()函数
  • 原文地址:https://www.cnblogs.com/Fandyx/p/1895694.html
Copyright © 2011-2022 走看看