Introduction
Suppose you want to run a Dynamics AX report, and save the output to a file, for example a PDF file. This can be done easily by clicking the Options button when running the report. Next you can choose Send to File, and you can specify the File name and File format.
If we do this for example for the Customer turnover report (Accounts receivable>Reports>Statistics>Customer>Customer turnover), then your input should look like below and you’ll receive a nice PDF file.
Problem Description: infolog asking to overwrite the existing file
If you run the report twice with the same File name, you’ll get a infolog mentioning the File <filename> already exists. Overwrite?
This could be a problem if you had chosen to run the report in Batch, for example every night. This Overwrite question will prevent the report of generating the output File, since it will be waiting for a user interaction to confirm the existing file can be overwritten.
Solution: Modify init method and modify RunOn property
To suppress this overwrite question, follow the two steps as below:
- Step 1: Add following code to the init method of the report.
public void init()
{
super();
// suppress overwrite message
element.printJobSettings().warnIfFileExists(false);
…
}
- Step 2: Modify the RunOn property of the corresponding Menu Item so its value equals Client. In our example we’ll modify the Menu Output Item CustRevenue as in below screenshot.
Hi patrik,
I'm Koekoeh from Indonesia.
I've just made a new account in DotNetKicks.com and want to submit a story. But unfortunately the system force me to answer five words related to .NET
Could you please help me to answer it? I really need your help.
Best regards;
Koekoeh
If you submit a story, you need to choose one category related to .NET for your story indeed: what is your problem exactly with it?
nice blog.i like it..
Post a Comment