Bài viết liên quan

Tạo class BOMStructureExplodingController


01/10/2020- duocnt    794 Views    

NỘI DUNG

 - Tạo class BOMStructureExplodingController  extends SrsReportRunController.

 - Tạo phương thức mới getReportName()

    protected str getReportName(BOMStructureExplodingContract _contract)
    {
        str reportNameLocal;
        if(_contract.parmCollapse()==NoYes::Yes)
        {
            reportNameLocal = ssrsReportStr(BOMStructureExplodingReport,Collapse);
        }
        else
        {
            reportNameLocal = ssrsReportStr(BOMStructureExplodingReport,Expand);
        }
        return reportNameLocal;
    }

 - Override phương thức preRunModifyContract().

    protected void preRunModifyContract()
    {
        BOMStructureExplodingContract contract = this.parmReportContract().parmRdpContract();
        this.parmReportContract().parmReportName(this.getReportName(contract));
        super();
    }

 - Gọi hàm main().

    public static void main(Args _args)
    {
        BOMStructureExplodingController controller = new BOMStructureExplodingController();
        controller.parmReportName(ssrsReportStr(BOMStructureExplodingReport,Expand));
        controller.parmArgs(_args);
        controller.startOperation();
    }

CODE X++

 - Full code cho BOMStructureExplodingController  .

class BOMStructureExplodingController  extends SrsReportRunController
{
    protected str getReportName(BOMStructureExplodingContract _contract)
    {
        str reportNameLocal;
        if(_contract.parmCollapse()==NoYes::Yes)
        {
            reportNameLocal = ssrsReportStr(BOMStructureExplodingReport,Collapse);
        }
        else
        {
            reportNameLocal = ssrsReportStr(BOMStructureExplodingReport,Expand);
        }
        return reportNameLocal;
    }
 
    protected void preRunModifyContract()
    {
        BOMStructureExplodingContract contract = this.parmReportContract().parmRdpContract();
        this.parmReportContract().parmReportName(this.getReportName(contract));
        super();
    }
 
    public static void main(Args _args)
    {
        BOMStructureExplodingController controller = new BOMStructureExplodingController();
        controller.parmReportName(ssrsReportStr(BOMStructureExplodingReport,Expand));
        controller.parmArgs(_args);
        controller.startOperation();
    }
}

Góp ý kiến

;
;