zoukankan      html  css  js  c++  java
  • OpenPrinter_1: rc:0 lastError:1801(0x709) The printer name is invalid

    When I open or active the report in Dynamics AX 2009,system will pop up this Error message.

    Error message as below:

    OpenPrinter_1: rc:0 lastError:1801(0x709) The printer name is invalid.

    Recently we were able to solve an issue with the print medium on certain reports. It is not changed immediately in a report print dialog option when it is generated from a class that extends RunBaseReportDialog.
    This works fine when printing a standard report without extending from the RunBaseReportDialog class, (menu item object type is report).

    The problem was caused by the following code line in method Classes/RunBaseReportDialog/main().
    The prompt is called from the reportRun object instead of the reportDialog object .

    res = reportRun.prompt();


    To solve the problem we therefore had to change the code line like this:

    res = reportDialog.prompt();

    Classes - > RunBaseReportDialog - > main() method as below:

    static void main(Args args)
    {
    RunBaseReportDialog reportDialog
    = new RunBaseReportDialog(args.caller());
    RunBaseReport runBaseReport
    = args.caller().runbase();
    ReportRun reportRun
    = runBaseReport.reportRun();
    Report report
    = reportRun.report();
    boolean oldInteractive;
    boolean res;
    Dialog dialog;
    ;
    // We must invoke the SysPrintForm via the report object so that we honor an prompt overrides.
    oldInteractive = report.interactive();
    report.interactive(
    true);

    //res = reportRun.prompt();//removed by Jimmy 2010-12-28
    res = reportDialog.prompt();//Added by Jimmy 2010-12-28

    report.interactive(oldInteractive);
    if (!res)
    return;

    dialog
    = Dialog::getDialogFromCaller(args.caller());
    if (dialog)
    {
    dialog.updateServer();
    }
    runBaseReport.dialogUpdatePrinterSettings(dialog);
    reportDialog.run();
    }

    annother method just reset user data  and set the report - > design (property)- >  orientation (Portrait / Landscape set up as Auto)

  • 相关阅读:
    and &&区别
    redis服务意外停止
    shell基础之bash
    vbox的桥接网络
    apache安装及相应配置
    https服务器配置部署
    nginx + php + mysql安装、配置、自启动+redis扩展
    VirtualBox安装linux
    本地检出远程分支
    linux下的crontab安装及简单使用
  • 原文地址:https://www.cnblogs.com/Fandyx/p/1918968.html
Copyright © 2011-2022 走看看