Skip to main content

Microsoft Dynamics NAV 2016 - Save Export To Excel With NAS!

Hi All,


If you remember we discussed in Past about Saving Excel File in NAV 2013, NAV 2013 R2 & NAV 2016.

If you want to read the details then refer links below -

NAV 2013 and NAV 2013 R2 - Save Export To Excel.

NAV 2016 - Save Export To Excel.

But some of the Readers have commented that the solution is not working with NAS. So in this article, we will discuss how we extend the old custom solution that it works with NAS and without NAS.



Let's Start with Error Message that system is generating, when we configure Report with Save As Excel in NAS -  
Microsoft Dynamics NAV Server attempted to issue a client callback to download a file: Book1.xlsx (Codeunit 419 File Management). Client callbacks are not supported on Microsoft Dynamics NAV Server.


The Demo and Objects at the end of the article are from NAV 2016 W1. If you want you can customize the solution in old Versions (2013 and 2013 R2).

Let's see what we need to change in the old solution to Support it with NAS - 

Customize Excel Buffer (Table 370) - 

1. Start By Adding a Global Variable - RunFromNas.



2. Add a New Function SetRunViaNAS as shown below.


3. Change the Function CreateBookAndSaveExcel. We will change the function if it Run from NAS then file will be saved in Server otherwise Save File to Client.


4. The Function MoveExcelInServer will Copy file within Server after report execution is completed.


5. If you want to configure the Report in NAS then just add a line in the report Before calling CreateBookAndSaveExcel that set it is running from NAS.



Objects can be downloaded from - Dynamics User Group or Skydrive.

File Name  - NAV 2016_Save to Excel_With NAS

** If you are planning to merge it into a custom database then the attachment have before and after the text files are available in the download files.

You can also make it more generic by passing File Name from the Report Itself.

Your comments and feedback are welcome. Stay tuned for more.

Regards,
+saurav dhyani
+Saurav Dhyani - Microsoft Dynamics Navision
saurav-nav.blogspot.com

Comments

Popular posts from this blog

Microsoft Dynamics NAV 2016 - How to Configure Phone Client.

Hi All, In this article we will discuss how we can connect Microsoft Dynamics NAV 2016 with New Client Launched i.e. Phone Client. This Article Contain Steps for a Android Phone as I have Only Android Phone. I am doing it having all tiers on my windows 8 machine, steps remain same for multiple servers but issues might be different. What we Need (Other what we discuss in this article) -  The Service Tier should be on Public IP . Some of the Data-card does not Provide you Public IP. check it for sure.

MSDYN365BC - Data Upgrade To Microsoft Dynamics 365 Business Central on premises.

Hi Readers, We have already talked about the number of steps for upgrading to Business Central on Premises from different NAV versions. After that article, I received multiple requests for an article which list down steps for Data Migration. In this article, we will discuss steps of data migration to MSDYN365BC (on-Prem) from NAV 2017. For this article, I am considering a Cronus Demo Database without any customization. For an actual upgrade project, we will have to complete object merge using compare and Merge process. After the Merge Process, the next step is data migration. Let's discuss those steps. Direct Upgrade to Microsoft Dynamics 365 Business Central (on-Prem) is from following versions - 1. NAV 2015. 2. NAV 2016. 3. NAV 2017. 4. NAV 2018.

🚀 Exploring Vibe Coding with GitHub Copilot for Business Central.

Hi All, In a recent #BCOpenDiscussion session, we delved into the fascinating concept of Vibe Coding —a new way of building software where developers collaborate with AI (like GitHub Copilot) to co-create solutions.  The session covered practical setup, how AI understands context, and even touched on Microsoft's new Model Context Protocol (MCP) integration for enhanced learning. Let’s break down the journey, step by step.