• 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)

  • 相关阅读:
    如何消除inline-block元素间间距问题(转)
    winform 自定义控件引用问题
    winform在设置控件enabled=false后,无法更改控件字体颜色的问题
    【Idea maven】springMvc访问不到静态资源的问题 (访问不到图片,css等
    Cannot resolve method 'setAttribute(java.lang.String, java.lang.String)'
    Idea tomcat启动问题 8080端口被idea占用
    贪心算法
    栈、队列、堆随笔
    ubuntu18.04安装配置tomcat8.5
    链表随笔
  • 原文地址:https://www.cnblogs.com/Fandyx/p/1918968.html
Copyright © 2020-2023  润新知