X++ code to generate SSRS Report Attachment in D365FO
Below is the code snippet which helps to generate SSRS report as memory stream and then can be used it to send it through mail/upload in azure. public static System.IO.Stream generateAttachment(PurchTable _purchTable) { PurchTable purchTable = PurchTable::find(_purchTable.PurchId); SrsReportRunController ssrsController = new SrsReportRunController(); ANI_PurchPurchaseOrderContract Contract = new ANI_PurchPurchaseOrderContract();//contract class System.Byte[] reportBytes = new System.Byte[0](); SRSProxy srsProxy; SRSReportRunService srsReportRunService = new SrsReportRunService(); Microsoft.Dynamics.AX.Framework.Reporting.Shared.ReportingService.ParameterValue[] parameterV...