static void DynamicsReportX(Args _args)
{ #AOT str reportName = 'tmp_DynamicxReport_'+curUserID(); tableid custTableId = tablenum(CustTable); TreeNode reportNode = TreeNode::findNode(#ReportsPath); Report areport; ReportDesign design; ReportAutoDesignSpecs specs; ReportSection section; ReportRun run; ; // 若存在则先删除,为了避免多用户冲突,报表名后加用户ID areport = reportNode.AOTfindChild(reportName); if (areport) areport.AOTdelete(); areport = reportNode.AOTadd(reportName); areport.query().addDataSource(custTableId); design = areport.addDesign('Design'); specs = design.autoDesignSpecs(); section = specs.addSection(ReportBlockType::Body, custTableId); section.addControl(custTableId, fieldnum(CustTable, AccountNum)); section.addControl(custTableId, fieldnum(CustTable, Name)); section.addControl(custTableId, fieldnum(CustTable, phone)); areport.interactive(false); areport.query().interactive(false); areport.AOTcompile(); run = ClassFactory.reportRunClass(new Args(reportName)); run.init(); run.run(); }
|