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)

  • 相关阅读:
    关闭各种浏览器自动更新的方法
    新中新question
    linux忘记root密码后的解决办法
    Linux下的命令
    windows未启用Administrator账户
    Jenkins安装以及邮件配置
    pl/sql不能复制粘贴
    python-装饰器&自动化框架搭建
    进程练习——生成指定规格的图片
    python-类的各种方法
  • 原文地址:https://www.cnblogs.com/Fandyx/p/1918968.html
Copyright © 2011-2022 走看看