Skip to main content

Posts

Showing posts with the label ax 2012 reporting ssrs

How To: Directing Reports to Email

Step 1/2: Create a session management class To send reports via Email from code you can use the new SrsReportRunController class. In the following example the report is initiated without a dialog and dispatched to the designated receiver. Create a new class, name it AXSalesReportToEmail  and add the following code: public static void  main(Args _args) {     SrsReportRunController controller =  new  SrsReportRunController();     SRSPrintDestinationSettings printSettings;     SrsReportEMailDataContract emailContract;      // set report name      controller.parmReportName( ssrsReportStr (AXSalesReportNew, AutoDesign1));      // create email contract      emailContract =  new  SrsReportEMailDataContract();      // fill in the email contract details      emailContract.parmAttachmentFileF...