Excel Buffer + NAS in NAV2013?
Miklos_Hollender
Member Posts: 1,598
First of all about the old, Classic Excel buffer: it worked with COM objects, and while Excel COM objects were never meant to be used without a GUI, as a Windows Services (which the Application Server is) I found if I comment out the code that sets the margin and page layout stuff then it works. So I based many important reports on it, automatically e-mailing the files with the SMTP Mail codeunit and scheduling it automatically with Job Queue because this is how it should be in the 21st century: managers should not need to have to log in to Navision and run a report, but have weekly sales etc. delivered in e-mail automatically.
Eventually we are going to have to upgrade, I would like to ask whether in the NAV 2013 the Excel Buffer with its new, .NET based operation can work with a scheduled GUI-less background service, like the NAS or something similar? Also including the kind of formatting changes recommended in the blogs i.e. background colors etc. with OpenXML?
Eventually we are going to have to upgrade, I would like to ask whether in the NAV 2013 the Excel Buffer with its new, .NET based operation can work with a scheduled GUI-less background service, like the NAS or something similar? Also including the kind of formatting changes recommended in the blogs i.e. background colors etc. with OpenXML?
0
Comments
-
I believe that in the 21st century, such reports should be created and scheduled using a separate reporting tool and not from within NAV.
But that aside, I know some people are using http://closedxml.codeplex.com/ to create Excel files through .net interop, without the need for Excel libraries.No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)0 -
Given that NAV has Job Scheduler, Excel Buffer, SMTP, adding as SaveAs option and mailing it is not an "un-Navisionific" solution.
Pretty much every reporting tools I found has limitations and I hate ever having to say "can't" to users.
I actually made a reporting tool on my own as a bunch of PowerShell scripts, because that is basically the new visual basic, a set of functions that read SQL stored procedures and write and send Excel files.
This works well enough for simpler reports, but in more complex ones there SQL joins and unions reach their limits and the only solution is iterating through cursors. That sort of thing is better done in C/AL. Plus, SQL doesn't have CHANGECOMPANY, and I consolidate information from multiple companies in my reports. Managers love this stuff, when every worksheet is a different company and they can check all in one file.
For this reason, I would like to operate within the logic of NAS if it works. Replacing the .NET libraries it uses it with another .NET library is an option, but only if truly necessary...0 -
So, does anyone know that the new, .NET based Excel Buffer in NAV 2013 works with NAS i.e. without a GUI?0
-
I am actually encountering a similar problem using Job Queue, NAS and Excel in NAV 2013.
Using the commented code below I get
// FileObject.CopyFile(FileNameServer,InFilePath);
//FileNameClient := FileManagement.DownloadTempFile(FileNameServer);
//FileNameClient := FileManagement.MoveAndRenameClientFile(FileNameClient,'Book1.xlsx',InFilePath);Microsoft Dynamics NAV
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.
OK
I tried using
XlWrkBk.SaveAs(InFilePath);
XlWrkBk.Close(FALSE);
XlApp.Quit;
But since NAV 2013, .NET INTEROP is used instead of Automation, so there are a lot of parameters to pass.
Will post the solution once I find it.Miklos Hollender wrote:So, does anyone know that the new, .NET based Excel Buffer in NAV 2013 works with NAS i.e. without a GUI?Blog: http://www.kaizenlog.com0 -
any update on this? I have a modified Aged AR that we export to XL via the Excel Buffer. I modified the Excel Buffer table to save to a network path per a MiBuso blog and created a codeunit that runs the export just fine when I run it from object designer. However, when I try to schedule the codeunit to run, it always fails with the error show below.
Microsoft Dynamics NAV
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.
OK
The Excel Buffer table has the added function SaveExcel, and the following two lines are present.
FileNameClient := FileManagement.DownloadTempFile(FileNameServer);
FileNameClient := FileManagement.MoveAndRenameClientFile(FileNameClient,FileName,FilePath);
I understand that the NAS is probably not happy with the DownloadTempFile call, is there an alternative I can use? I just want to take an existing report that is frequently executed during the day and be able to automate it's output over the weekend.
kind of fell into this...0 -
I went through this with Debugger and found it's actually choking at a call to PreOpenExcel.
FileManagement.DownloadHandler throws the error about callback. I found a thread online suggesting to use Workbook method SaveAs, but when I try to use that, I still get the call back error on the following line of code.
XlApp := XlApp.ApplicationClass;
Is anyone else doing what I'm trying to accomplish with the Excel Buffer? what's your approach?kind of fell into this...0 -
Sorry for the late answer, but due to needs like multiple sheets, background colors which sound difficult in the standard, I use Gunnar's ClosedXML Excel Buffer with slight modifications. http://www.dynamics.is/?p=1724 I think the only change I had to do was to comment out the BorderAround stuff as that did not seem to work with the NAS, and add these stuff I am using like Backcolor field, functions like AddSheet, MakeASum, SaveAndSendMail etc. I would share it but it is not very clean, I don't 100% remember what is what...0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 323 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions

