Excel in NAV 2009 RTC (Budget - Export to Excel)

Tronholm
Member Posts: 22
In NAV 5.0 you have Export to Excel / Import from Excel for example in 'General Ledger - Budget - Functions'. This is not present in NAV 2009. This functionality is based on Table 370 Excel Buffer, which uses variables of type Automation to CREATE and use an instance of EXCEL.
Now I use 370 Excel Buffer extensively for reporting. It still works in NAV 2009 Classic Client, buy I can't get it working in NAV 2009 RTC. The NAV Server is running on the same PC as the client (my desktop, actually). I get an error when I try
CREATE (XlAPP, TRUE, TRUE) in RTC.
Any hint?
Now I use 370 Excel Buffer extensively for reporting. It still works in NAV 2009 Classic Client, buy I can't get it working in NAV 2009 RTC. The NAV Server is running on the same PC as the client (my desktop, actually). I get an error when I try
CREATE (XlAPP, TRUE, TRUE) in RTC.
Any hint?
0
Answers
-
Try to delete your personalization data - If you answered Never Allow to run Excel, that will automatically prevent any future use on your client.
del "%appdata%\Microsoft\Microsoft Dynamics NAV\PersonalizationStore.xml"
If you still have the problem - try attaching a debugger and break on errors, this often gives you a better idea of what is happening. There is a guide on debugging on http://blogs.msdn.com/clausl/archive/2008/10/14/debugging-in-nav-2009.aspx
PS: A little tip to debuggin is to create the breakpoint manually. In VS go Debugging -> New BreakPoint -> Break af Function -> Record370.CreateBook, and you will break straight into the CreateBook method on table 370.
/PhillipPhillip Kirkby
Software Development Engineer
Microsoft Dynamics NAV0 -
Thanks. Deleting "%appdata%\Microsoft\Microsoft Dynamics NAV\PersonalizationStore.xml" actually made the thing work ONCE! in RTC.
I think there might be some bug in RTC preventing the COM to work. This is a the very simple codeunit that just opens Excel in a window. It works fine in Classic, and worked just once in RTC:
Variables:
Name DataType Subtype Length
XlApp Automation 'Microsoft Excel 12.0 Object Library'.Application
Code:
OnRun()
CREATE(XlApp,TRUE);
XlApp.Visible(TRUE);
XlApp.UserControl(TRUE);
In RTC, this error appears when executing CREATE:
This message is for C/AL programmers: Unable to create an instance of Automation Server Microsoft.Office.Interop.Excel.ApplicationClass with CLSID = 00024500-0000-0000-C000-000000000046 Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005..
I've tried with other Automation Servers with same results (works ok in Classic, error in RTC).
Have anybody actually tried this out in RTC?0 -
CREATE has a new optional third parameter called 'ClientSide' which determines if the automation variable is instantiated on the service tier or on the client computer. I would try setting that to TRUE, which I would expect to create the instance of the Excel app on the client side.
I don't know if that'll work though, I have not tried that yet. I have a feeling that I will have to very soon due to a project I am working on, but for now I'll let you take a shot at it0 -
Thanks! This actually works. Three learnings from this:
1) When using automation from NAV 2009 RTC, you must take care of "%appdata%\Microsoft\Microsoft Dynamics NAV\PersonalizationStore.xml" and eventually delete this file if some user has not answered correctly when asked to allow or not execution of the instanciated application.
2) There is a third (undocumented?) parameter in the CREATE function to tell RTC to instanciate on the client side: CREATE(XlAPP,TRUE,TRUE). You have to fix code in table 370 Excel Buffer if you want to use it on RTC.
3) Somo functionality is not available or tested yes in NAV 2009 Role Tailored Client.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
- 320 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