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

VIEW SERVER STATE permission on SQL Server?

Hi all, Sometime While trying to Login into a database we face an error message as shown below. --------------------------- Microsoft Dynamics NAV Classic --------------------------- You cannot start Microsoft Dynamics NAV Classic because you do not have the VIEW SERVER STATE permission on SQL Server. Contact your system administrator. --------------------------- OK    ---------------------------

RTC Report It is not possible to instantiate the Visual Studio bridge.

Hi all, As a Navision developers I have Multiple Versions of Navision running in single Machine. As discussed Earlier in the post how to run multiple Version of RTC in single machine. So my machine have following details for RTC Versions - NAV 2009 R2    - is installed. NAV 2009 SP1  - is copied at C:\Program Files (x86)\Microsoft Dynamics NAV\60\NAV 6.0 SP1 IN\ NAV 2009         - is copied at C:\Program Files (x86)\Microsoft Dynamics NAV\60\NAV 6.0 IN\ This approach has been working great for execution of Classic and RTC Clients. However, after installing Dynamics NAV 2009 R2, if i tried to view the Layout for an NAV 2009 SP1 Report i was getting the following error: ---------------------------  Microsoft Dynamics NAV Classic  ---------------------------  It is not possible to instantiate  the Visual Studio bridge.  ---------------------------  OK    --------------------------- After searchi...

NAV 2013 R2 - Cumulative update 12 Released.

Hi all, Please find below the details of  Cumulative Update 12 released for Microsoft Dynamics NAV 2013 R2. Title - Cumulative Update 12 for Microsoft Dynamics NAV 2013 R2 Build No. - 38053 Release Date - October, 2014 Local Version Included - AU, AT, BE, CH, DE, DK, ES, FI, FR, IS, IT, NA, NL, NO, NZ, SE, UK, RU Download Link Note: Implementing this cumulative update will require a database conversion unless you have already implemented update rollup 5.