AX2009 Report export to outlook express.

Hi Guys.

I have a requirement to attach a axapta report with outlook express.


I have a purchase order form and i made a button EMAIL. What i need is that when i click this button it should open the outlook express and attach the Purchase order report .pdf with this email message.

Please guys if you have any thing like this i will be very thankful any idea or link how to achieve this requirement.


Hi Kami,

You can take help from the below code and put the modified code in the click event of Email button

  1. Create PrintJobSetting object and set the properties as below


  1. Run your report through code like i run the sales invoice report.

salesFormLetter = SalesFormLetter::construct(DocumentStatus::Invoice, false);
new MenuFunction(menuitemoutputstr(SalesInvoice), MenuItemType::Output).run(args);

After executing the run method system will open the outlook with the pdf report as an attachement.

I hope it will work for you.



Hi Zeeshan,

I have found the following code and it is working but the problem is there are 2 issues i am facing can you please help me on these

When i click the button it gives the print dialog box selecting the E-mail recipient option as the default. Then when i click OK i get the warning window from Outlook saying “A program is trying to access e-mail address you have …” How to stop this window to display. After i select YES it directly send the email i want to it be opened in the outlook to write the text for the email body.

void clicked()
Args aa = new Args(“TestReport”);
ReportRun rn = new ReportRun(aa);

rn.printJobSettings().mailSubject(“test subject”);;