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)

  • 相关阅读:
    js经典试题之数据类型
    js单行写一个评级组件
    Spring Cloud Gateway的全局异常处理
    spring cloud gateway 全局过滤器
    公司ES升级带来的坑怎么填?
    Sentinel: 分布式系统的流量防卫兵
    微信小程序之页面打开数量限制
    微信小程序登录那些事
    API数据加密框架monkey-api-encrypt
    微信小程序之启动页的重要性
  • 原文地址:https://www.cnblogs.com/Fandyx/p/1918968.html
Copyright © 2011-2022 走看看