I'm trying to run a report on the server (AOS) and make it print to a 
printer on the server itself.  Even if the code is running on the 
server, the report always end up printing on the client side.  
If "MyPrinter" doesn't exist on the client (it exist on the server) 
it's using the default client printer.  I've also enabled "Allow 
clients to use printers on the server" on the AOS but with no luck.

Inspired from EPSendDocument class, here's what I've got so far.

static server void serverPrintTest(){
    PrintJobSettings            pjs;

    Args                        args;
    ReportRun                   rr;
    Report                      rb;
    ;

    args = new Args(reportStr(Report1));

    rr = new ReportRun(args);

    rb = rr.report();
    rr.suppressReportIsEmptyMessage(true);
    pjs = rr.printJobSettings();
    pjs.virtualPageHeight(0);
    pjs.fitToPage(true);

    rb.interactive(false);
    rr.query().interactive(false);

    pjs.setTarget(PrintMedium::Printer);
    pjs.deviceName("MyPrinter", ClassRunMode::Server);

    rr.init();

    pjs.setTarget(PrintMedium::Printer);
    pjs.deviceName("MyPrinter", ClassRunMode::Server);

    rr.run();
}

Any help would be appreciated.  I'm running Ax 3.0 SP3 KR3

Reply via email to