Notifications
Announcements
Hi ,
I am trying to appending row data to a existing excel file via x++ code. While trying to append rows, the process is working fine but atlast the datas are not added to the excel. The iteration are executing correctly while debuging. But i think saving the file with memoryStream is happening some issue. Can anyone help me in this.
Hi Anoop, I am not sure but can you try moving package.Save() inside the loop before i++.
Check this article
www.d365snippets.com/.../how-to-create-and-export-excel-files-using-xpp-in-d365.html
Will it change if you save it to another stream with SaveAs()?
using (System.IO.MemoryStream outputStream = new System.IO.MemoryStream()) { package.SaveAs(outputStream); File::SendFileToUser(outputStream, 'test.xlsx'); }
Thanks Martin, Actually It worked
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
Thanks to all of our 2025 Community Spotlight stars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
André Arnaud de Cal... 622 Super User 2025 Season 2
Abhilash Warrier 438 Super User 2025 Season 2
Martin Dráb 354 Most Valuable Professional