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();
    }
  • 相关阅读:
    平台调用中的数据封送处理
    JavaScript 中的事件流
    Jquery插件 表格固定表头
    ASP.NET MVC Action Filter与内置的Filter实现
    getCurrentScript的改进
    analyze spring framework source
    Windows Azure: Service Bus Brokered Messaging DeadLetterQueue 使用详解
    C#截图
    权限系统
    音乐播放器
  • 原文地址:https://www.cnblogs.com/Fandyx/p/1895694.html
Copyright © 2011-2022 走看看