-
Notifications
You must be signed in to change notification settings - Fork 278
Report.SAVEAS issue on 16x version #5784
Copy link
Copy link
Closed
Labels
Description
Describe the bug
I have a Maintenance Order and I want to save as pdf and then send it through email. When the Repot.SaveAs is executed there are only some business events that are executed (SubstituteReport, HasCustomLayout, GetPaperTrayForReport) and then the system exit the code (The report is not run)
To Reproduce
EmpireSingleInstance.SetReportAsDocument(true);
RecRef.GetTable(MaintenanceOrder);
recref.SetRecFilter();
TempBlob.CreateOutStream(OutStr);
_REPORT.SAVEAS(ReportSelectionDO."Lijst-ID", Params, REPORTFORMAT::Pdf, OutStr, RecRef);_
TempBlob.CreateInStream(InStr);
EmpireSingleInstance.SetReportAsDocument(false);
Expected behavior
The report should run. This happens only for the 16x version. In 15x everything is working fine. I didn't managed to repro on standard.
Error
Error Message: Unexpected CLR exception thrown.: System.ArgumentNullException: Value cannot be null.
Parameter name: reportLayout
at Microsoft.Dynamics.Nav.Types.Report.Runtime.LocalReportHandle..ctor(Int32 reportId, Byte[] reportLayout, Boolean enableExternalImages, Boolean enableHyperlinks, Boolean enableExternalAssemblies, Boolean enableReportViewerInternalAppDomainIsolation, Boolean enableAppDomainMonitor)
at Microsoft.Dynamics.Nav.Runtime.NavSession.<>c.<get_LocalReportCache>b__171_0(MetaReport metaReport)
at Microsoft.Dynamics.Nav.Runtime.LocalReportCache.GetLocalReport(MetaReport metaReport)
at Microsoft.Dynamics.Nav.Runtime.NavReport.EffectiveLocalReportHandle()
at Microsoft.Dynamics.Nav.Runtime.ReportSaveAsRenderer.Start()
at Microsoft.Dynamics.Nav.Runtime.DataItemIterator.ExecuteDataItemIterator()
at Microsoft.Dynamics.Nav.Runtime.NavReport.<>c__DisplayClass143_0.<RunReportInternal>b__0()
at Microsoft.Dynamics.Nav.Runtime.ApplicationObjectRootScope.AddApplicationObjectRootScope[T](NavApplicationObjectBase applicationObject, Func`1 action)
at Microsoft.Dynamics.Nav.Runtime.NavReport.SaveReportAsFormat(NavRecord record, IResultSetProcessor resultSetProcessor, String fileName, ReportFormat format, String tempFilePath)
at Microsoft.Dynamics.Nav.Runtime.NavReport.SaveAs(DataError errorLevel, NavOutStream outStream, ReportFormat format, NavRecordRef recordRef)
at Microsoft.Dynamics.Nav.Runtime.NavReport.SaveAs(DataError errorLevel, Int32 reportId, String parameters, NavReportFormat reportFormat, NavOutStream outStream, NavRecordRef recordRef)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit11031278.SaveMaintenanceOrderReportAsPDF_Scope_408614207.OnRun()
at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.Run()
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit11031278.SaveMaintenanceOrderReportAsPDF(INavRecordHandle maintenanceOrder, INavRecordHandle reportSelectionDO)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit11031278.DoPrintMaintenanceOrder_Scope__299956958.OnRun()
at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.Run()
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit11031278.DoPrintMaintenanceOrder(INavRecordHandle maintenanceOrder, Boolean sendAsEmail, Boolean noUserInput)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit11031278.EmailMaintenanceOrderFromPurchaseHeader_Scope__1700283013.OnRun()
at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.Run()
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit11031278.EmailMaintenanceOrderFromPurchaseHeader(INavRecordHandle purchaseHeader, Boolean noUserInput)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit11031278.OnInvoke(Int32 memberId, Object[] args)
at Microsoft.Dynamics.Nav.BusinessApplication.Record11024475.ProcessOutput_Scope_1112760115.OnRun()
at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.Run()
at Microsoft.Dynamics.Nav.BusinessApplication.Record11024475.ProcessOutput(INavRecordHandle purchaseHeader)
at Microsoft.Dynamics.Nav.BusinessApplication.Record11024475.OnInvoke(Int32 memberId, Object[] args)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit11151891.AwardPurchaseOrder_Scope_798034249.OnRun()
at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.Run()
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit11151891.AwardPurchaseOrder(INavRecordHandle purchaseHeader)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit11151891.OnInvoke(Int32 memberId, Object[] args)
at Microsoft.Dynamics.Nav.BusinessApplication.Record11024475.AutoAwardPurchaseOrder_Scope_1870922567.OnRun()
at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.Run()
at Microsoft.Dynamics.Nav.BusinessApplication.Record11024475.AutoAwardPurchaseOrder(INavRecordHandle purchaseHeader)
at Microsoft.Dynamics.Nav.BusinessApplication.Record11024475.OnInvoke(Int32 memberId, Object[] args)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit11151560.AutoAwardPurchOrderOnAfterReleasePurchDoc_Scope.OnRun()
at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.Run()
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit11151560.AutoAwardPurchOrderOnAfterReleasePurchDoc(INavRecordHandle purchaseHeader)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit11151560.OnInvoke(Int32 memberId, Object[] args)
at Microsoft.Dynamics.Nav.EventSubscription.NavEventScope.CallEventSubscriberInternal(NavEventSubscription subscriber, NavApplicationObjectBase subscriberInstance, Object[] parameters)
at Microsoft.Dynamics.Nav.EventSubscription.NavEventScope.CallEventSubscriber(NavApplicationObjectBase callingApplicationObject, NavEventSubscription subscriber, NavApplicationObjectBase subscriberInstance, Object[] parameters)
at Microsoft.Dynamics.Nav.EventSubscription.NavEventScope.ProcessCallToTypeAndManualSubscriptions(NavApplicationObjectBase callerApplicationObject, NavEventSubscription[] subscriptions, PrepareParametersCallBack prepareParameters)
at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.OnRunEvent()
at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.Run()
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit415.OnAfterReleasePurchaseDoc(INavRecordHandle purchaseHeader, Boolean previewMode, ByRef`1 linesWereModified)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit415.Code_Scope__1940888267.OnRun()
at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.Run()
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit415.Code()
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit415.OnRun_Scope.OnRun()
at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.Run()
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit415.OnRun(INavRecordHandle εrec)
at Microsoft.Dynamics.Nav.Runtime.NavCodeunit.DoRun(DataError errorLevel, NavRecord record)
at Microsoft.Dynamics.Nav.Runtime.NavCodeunit.RunCodeunit(DataError errorLevel, Int32 objectId, NavRecord record)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit11151560.OnBeforePerformManualRelease_Scope.OnRun()
at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.Run()
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit11151560.OnBeforePerformManualRelease(INavRecordHandle purchaseHeader, Boolean previewMode, ByRef`1 isHandled)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit11151560.OnInvoke(Int32 memberId, Object[] args)
at Microsoft.Dynamics.Nav.EventSubscription.NavEventScope.CallEventSubscriberInternal(NavEventSubscription subscriber, NavApplicationObjectBase subscriberInstance, Object[] parameters)
at Microsoft.Dynamics.Nav.EventSubscription.NavEventScope.CallEventSubscriber(NavApplicationObjectBase callingApplicationObject, NavEventSubscription subscriber, NavApplicationObjectBase subscriberInstance, Object[] parameters)
at Microsoft.Dynamics.Nav.EventSubscription.NavEventScope.ProcessCallToTypeAndManualSubscriptions(NavApplicationObjectBase callerApplicationObject, NavEventSubscription[] subscriptions, PrepareParametersCallBack prepareParameters)
at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.OnRunEvent()
at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.Run()
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit415.OnBeforePerformManualRelease(INavRecordHandle purchaseHeader, Boolean previewMode, ByRef`1 isHandled)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit415.PerformManualCheckAndRelease_Scope_165551156.OnRun()
at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.Run()
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit415.PerformManualCheckAndRelease(INavRecordHandle purchHeader)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit415.PerformManualRelease_Scope_244650429.OnRun()
at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.Run()
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit415.PerformManualRelease(INavRecordHandle purchHeader)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit415.OnInvoke(Int32 memberId, Object[] args)
at Microsoft.Dynamics.Nav.BusinessApplication.Record11031279.CreateCustomApprovalEntry_Scope__1234091793.OnRun()
at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.Run()
at Microsoft.Dynamics.Nav.BusinessApplication.Record11031279.CreateCustomApprovalEntry(INavRecordHandle purchaseHeader, Boolean createApproval, NavDateTime awardedDateTime)
at Microsoft.Dynamics.Nav.BusinessApplication.Record11031279.OnInvoke(Int32 memberId, Object[] args)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit11031272.CreateApprovalEntry_Scope__1421738641.OnRun()
at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.Run()
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit11031272.CreateApprovalEntry(INavRecordHandle maintenanceOrder, NavDateTime approvalDateTime)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit11031272.CreateApprovalEntryForOrder_Scope__2125395074.OnRun()
at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.Run()
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit11031272.CreateApprovalEntryForOrder(NavArray`1 maintenanceTaskBuffer)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit11031272.CreateOrdersFromSelectedTasks_Scope__1356440353.OnRun()
at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.Run()
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit11031272.CreateOrdersFromSelectedTasks(INavRecordHandle dMMaintenanceTask)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit11031272.OnRun_Scope.OnRun()
at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.Run()
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit11031272.OnRun(INavRecordHandle εrec)
at Microsoft.Dynamics.Nav.Runtime.NavCodeunit.DoRun(DataError errorLevel, NavRecord record)
at Microsoft.Dynamics.Nav.Runtime.NavCodeunit.RunCodeunit(DataError errorLevel, Int32 objectId, NavRecord record)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit66002.CreateMaintenanceOrder_Scope_504973304.OnRun()
at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.Run()
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit66002.CreateMaintenanceOrder(INavRecordHandle maintenanceOrder, INavRecordHandle maintenanceTask, INavRecordHandle maintenanceRequest)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit66002.OnInvoke(Int32 memberId, Object[] args)
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit67183.AwardMaintenanceOrderByMail_Scope__243283885.OnRun()
at Microsoft.Dynamics.Nav.Runtime.NavMethodScope.Run()
at Microsoft.Dynamics.Nav.BusinessApplication.Codeunit67183.AwardMaintenanceOrderByMail() - Error Call Stack:
"DM - Maint. Order - Print"(CodeUnit 11031278).SaveMaintenanceOrderReportAsPDF line 14 - Base Application by cegeka-dsa
"DM - Maint. Order - Print"(CodeUnit 11031278).DoPrintMaintenanceOrder line 49 - Base Application by cegeka-dsa
"DM - Maint. Order - Print"(CodeUnit 11031278).EmailMaintenanceOrderFromPurchaseHeader line 8 - Base Application by cegeka-dsa
"Purchase Method"(Table 11024475).ProcessOutput line 50 - Base Application by cegeka-dsa
"TE Purchase Header"(CodeUnit 11151891).AwardPurchaseOrder line 15 - Base Application by cegeka-dsa
"Purchase Method"(Table 11024475).AutoAwardPurchaseOrder line 18 - Base Application by cegeka-dsa
"Release Purch. Doc. Handler"(CodeUnit 11151560).AutoAwardPurchOrderOnAfterReleasePurchDoc line 9 - Base Application by cegeka-dsa
"Release Purchase Document"(CodeUnit 415).OnAfterReleasePurchaseDoc line 2 - Base Application by cegeka-dsa
"Release Purchase Document"(CodeUnit 415).Code line 112 - Base Application by cegeka-dsa
"Release Purchase Document"(CodeUnit 415).OnRun(Trigger) line 3 - Base Application by cegeka-dsa
"Release Purch. Doc. Handler"(CodeUnit 11151560).OnBeforePerformManualRelease line 6 - Base Application by cegeka-dsa
"Release Purchase Document"(CodeUnit 415).OnBeforePerformManualRelease line 2 - Base Application by cegeka-dsa
"Release Purchase Document"(CodeUnit 415).PerformManualCheckAndRelease line 22 - Base Application by cegeka-dsa
"Release Purchase Document"(CodeUnit 415).PerformManualRelease line 9 - Base Application by cegeka-dsa
"DM - Maintenance Order"(Table 11031279).CreateCustomApprovalEntry line 22 - Base Application by cegeka-dsa
"DM - Maint. Tasks To M. Orders"(CodeUnit 11031272).CreateApprovalEntry line 17 - Base Application by cegeka-dsa
"DM - Maint. Tasks To M. Orders"(CodeUnit 11031272).CreateApprovalEntryForOrder line 9 - Base Application by cegeka-dsa
"DM - Maint. Tasks To M. Orders"(CodeUnit 11031272).CreateOrdersFromSelectedTasks line 22 - Base Application by cegeka-dsa
"DM - Maint. Tasks To M. Orders"(CodeUnit 11031272).OnRun(Trigger) line 5 - Base Application by cegeka-dsa
"Library - Maintenance"(CodeUnit 66002).CreateMaintenanceOrder line 9 - Test Application by Cegeka-dsa
"Order Notifications"(CodeUnit 67183).AwardMaintenanceOrderByMail line 23 - Test Application by Cegeka-dsa
"Test Runner - Mgt"(CodeUnit 130454).RunTests - Test Runner by Microsoft
"Test Runner - Isol. Codeunit"(CodeUnit 130450).OnRun - Test Runner by Microsoft
"Test Suite Mgt."(CodeUnit 130456).RunTests - Test Runner by Microsoft
"Test Suite Mgt."(CodeUnit 130456).RunSelectedTests - Test Runner by Microsoft
"AL Test Tool"(Page 130451)."RunSelectedTests - OnAction" - Test Runner by Microsoft
5. Versions:
- AL Language: 5.0.254558
- Business Central: sandbox:16.0.11240.11946-nl
Reactions are currently unavailable