注:
如果你有一个打印报表的任务,在客户端打印成功,但是当使用batch来打印时却遇到问题,那么你需要检查你的AOS的配置以及客户端的配置是否允许batch在服务器端打印报表。
并且,你必须检查batch是以AOS账户运行,还是以提交任务的用户身份运行的,检查对应的账户是否有足够的权限能够在服务器端使用打印机。
From: http://translate.googleusercontent.com/translate_c?hl=zh-CN&langpair=de%7Cen&u=http://blogs.msdn.com/emeadaxsupport/archive/2009/07/15/test.aspx&rurl=translate.google.com&client=tmpg&usg=ALkJrhjdwJ_Dcq2Tjijyz86Qiv_u8LrFew
We came across an issue reported to us where they were trying to automate printing of reports as PDF files using batch processing on the server. Printing reports directly worked fine and they were able to save the PDF files it generated successfully on the file system, but it only failed when using Batch. Printing reports directly worked fine and they were able to save the PDF files it generated successfully on the file system, but it only failed when using batch.
The issue occurred because the server had not been configured to allow printing on the server. The issue occurred because the server had not been configured to allow printing on the server. For reference here is the snippet of code that was being run to print the report on the server: For reference here is the snippet of code that was being run to print the report on the server:
reportRun = new reportRun (args) reportRun.query().interactive(False); reportRun.query (). interactive (false); reportRun.report().interactive(False); reportRun.report (). interactive (false); reportRun.setTarget(printMedium::File); reportRun.setTarget (print media:: File); reportRun.printJobSettings().setTarget(PrintMedium::File); reportRun.printJobSettings (). setTarget (Print Media:: File); reportRun.printJobSettings().preferredTarget(PrintMedium::File); reportRun.printJobSettings (). preferredTarget (Print Medium:: File); reportRun.printJobSettings().format(PrintFormat::PDF); reportRun.printJobSettings (). format (print format: PDF); reportRun.printJobSettings().warnIfFileExists(False); reportRun.printJobSettings (). warnIfFileExists (False); reportRun.printJobSettings().suppressScalingMessage(True); reportRun.printJobSettings (). suppressScalingMessage (True); reportRun.printJobSettings().packPrintJobSettings(); reportRun.printJobSettings (). pack Print Job Settings (); reportRun.printJobSettings().fileName(filename); reportRun.printJobSettings (). fileName (filename); reportRun.run(); (ReportRun.run);
Although you are not physically printing a report to a printer and saving it to file instead, the print x + + api's that are used require the same privileges as though you are printing to a printer on the server.
The issue was resolved by following the steps given in article Microsoft Dynamics AX reports under the section titled Enable users to print reports from the server. The issue was resolved by following the steps given in the article Microsoft Dynamics AX reports under the section titled Enable users to print reports from the server.
Microsoft Dynamics AX reports:
From: http://translate.googleusercontent.com/translate_c?hl=zh-CN&langpair=de%7Cen&u=http://technet.microsoft.com/en-us/library/aa834361.aspx&rurl=translate.google.com&client=tmpg&usg=ALkJrhgkoB1aZMfStl7pk_wMPzsB0W9qsA
Microsoft Dynamics AX includes hundreds of preconfigured reports that users can generate and print. These reports are called standard reports and auto reports . These reports are called standard reports and auto reports. Users can generate standard reports by clicking a link in the Reports area of a module's area page. Users can generate standard reports by clicking a link in the Reports area of a module's page area. Users can generate auto reports by clicking the Print icon on a form. Users can generate reports automatically by clicking the Print icon on a form
To enable users to generate and print standard and auto reports, complete the following procedures. To enable users to generate and print standard and auto reports, complete the following procedures.
Use the following steps to give a user group access to (or, restrict access to) standard reports. Use the following steps give to a user group access to (or, restrict access to) Standard reports.
Open the User group permissions form ( Administration > Setup > Security > User group permissions ). Open the User group permissions form (Administration> Setup> Security> User group permissions).
On the Overview tab, select a user group and a domain. On the Overview tab, select a user group and a domain.
Click the Permissions tab. Click the Permissions tab.
In the list, select the Reports security key that you want to configure. In the list, select the Reports security key that you want to configure.
In the Access section, select the View permission level. In the Access section, select the View permission level. After you select a permissions level, the selected security key shows a check mark to indicate that permissions have been set. After you select a permissions level, the selected security key shows a check mark to indicate that permissions have been set.
Click the Cascade button to ensure that all dependent security keys inherit this permission level. Click the Cascade button To ensure that all dependent security keys inherit this permission level.
Press CTRL+S to save your changes. Press CTRL + S to save your changes.
Restart the Dynamics AOS service if you changed the permissions of an existing user group, especially if you set more restrictive permissions for that group. Restart the Dynamics AOS service if you changed the permissions of an existing user group, especially if you set more restrictive permissions for that group.
To set permissions for another user group, repeat steps 2-8. To set permissions for another user group, repeat steps 2-8.
If a user has access to a form, the user can generate an auto report by clicking the Print icon on the form. This means that to restrict access to an auto report, you need to restrict access to the form from which it is generated. If a user has access to a form, the user can generate an automatic report by clicking the Print icon on the form to This means that restrict access to an auto report, you need to restrict access to the form from which it is generated.
For information about setting security permissions for a form, see Manage security permissions for user groups and domain combinations . For information about security permissions setting for a form, see Manage security permissions for user groups and domain combinations .
Printing reports from a server can be more efficient than printing from a client. Printing reports from a server can be more efficient than printing from a client. When printing a report from a client, Microsoft Dynamics AX must upload details about page size, report dimensions, fonts, and string sizes to the client before the report can print. When printing a report from a client, Microsoft Dynamics AX must upload details about page size, report dimensions, fonts, sizes and string To The client can print before the report. When printing a report from a server, these details are readily available. When a printing report from a server, these details are readily available. No extra processing is required. No extra processing is required.
To enable users to print reports from the server, you must configure the AOS server and each client. To enable users to print reports from the server, you must configure the server and client AOS each.
Complete the following steps on the AOS server: Complete the following steps on the AOS server:
Open the Server Configuration Utility ( Start > All Programs > Microsoft Dynamics AX ). Open the Server Configuration utility (Start> All Programs> Microsoft Dynamics AX).
Select the Allow clients to connect to printers on this server option. Select the Allow clients to connect to printers on this server option.
Click OK . Click OK.
Complete the following steps on each client computer: Complete the following steps on each client computer:
Open the Client Configuration Utility ( Start > All Programs > Microsoft Dynamics AX ). Open the Client Configuration Utility (Start> All Programs> Microsoft Dynamics AX).
Click the Connection tab. Click the Connection tab.
Select Connect to printers on the server . Select Connect to Printers on the server.
Click OK . Click OK.