AX 2012 MophX Report Export To File

    args                args;
    ReportRun           rr;
    Report              rb;
    PrintJobSettings    pjs;
    ;
    args= new Args("Report");
    args.record(common));
    args.parmEnum(PrintCopyOriginal::OriginalPrint);


    rr = new ReportRun(Args);
    rb  = rr.report();
    rr.suppressReportIsEmptyMessage(true);  // no more "Report is empty..." stuff
    pjs = rr.printJobSettings();
    pjs.virtualPageHeight(0);
    pjs.fitToPage(true);


    rb.interactive(false);
    rr.query().interactive(false);
    pjs.setTarget(PrintMedium::File);
    pjs.viewerType(ReportOutputUserType::HTML);
    rr.init();
    pjs.setTarget(PrintMedium::File);
    pjs.viewerType(ReportOutputUserType::HTML);
    pjs.format(printFormat::HTML);

    pjs.fileName(@"fileName");
    rr.run();

  

posted @ 2016-03-02 11:44  Sprite.z  Views(298)  Comments(0Edit  收藏  举报