AX2012SRS直接打印到文件

    Args                    Args;
    SrsReportRunController  controller;
    Common                  _record;
    SRSPrintDestinationSettings        printSettings;
    ;
    controller= new SrsReportRunController();
    controller.parmReportName("SysDataBaseLog.Report");
    Args = new Args();
    args.record(_record);
    controller.parmArgs(args);

    printSettings = controller.parmReportContract().parmPrintSettings();
    // set print medium 
    printSettings.printMediumType(SRSPrintMediumType::File); 
    printSettings.fileFormat(SRSReportFileFormat::Excel); 
    printSettings.overwriteFile(true); 
    printSettings.fileName("tempfilename.xlsx");

    // suppress the parameter dialog 
    controller.parmShowDialog(false);
    controller.parmLoadFromSysLastValue(false);
    // start operation 
    controller.startOperation(); 

 

posted @ 2016-03-02 10:13  止在入门  阅读(346)  评论(0编辑  收藏  举报