Applying Pivot Table in Excel using Automation Server Objects in NAV

In NAV when building a custom report that deals with totalling the amount by multiple G/L accounts by week then the report becomes tough to read as well as develop in standard SSRS Report. A possible and easy workaround is dumping all the entries in the Excel and performing the pivot table operation on the entries to give a precise results.

Bron : Cloudfronts
Lees meer…

Remove Namespace – Web Service Response (Automation Variable)

This Post is about How to Import directly an XML which is coming as Web-Service from different platform like .NET. Whenever we get a response from a .NET Service we usually get Namespaces coming as enclosed in it. Now being a NAV developer it’s something which becomes a barrier to us while getting it directly Imported from NAV XML Ports. So here we are to how get rid from this.

Bron : Research – Develop – Share – Repeat
Lees meer…

Using Automation to Write a Letter in Microsoft Office Word

Automation lets you use the capabilities and features of Microsoft Office products, such as Microsoft Word or Microsoft Excel, in your Microsoft Dynamics NAV application. Today we will implement Word Automation from a customer card in the Microsoft Dynamics NAV Windows client. Note: The Microsoft Dynamics NAV Web client does not support automation

Bron : Ashwini Tripathi
Lees meer…

Create any graph in NAV using Excel

ExcelApp Automation ‘Microsoft Excel 15.0 Object Library’.Application
ExcelBook Automation ‘Microsoft Excel 15.0 Object Library’.Workbook
ExcelSheet Automation ‘Microsoft Excel 15.0 Object Library’.Worksheet
ExcelRange Automation ‘Microsoft Excel 15.0 Object Library’.Range
ExcelChart Automation ‘Microsoft Excel 15.0 Object Library’.Chart
GraphFile File
MemStream InStream
OStream OutStream
Customer Record Customer


ExcelBook := ExcelApp.Workbooks.Add(-4167);
ExcelSheet := ExcelApp.ActiveSheet;
ExcelSheet.Name := ‘Sales customer’;

Customer.SETFILTER(“Date Filter”,’%1..%2′,010112D,311212D);
Customer.CALCFIELDS(“Sales (LCY)”);
ExcelSheet.Range(‘A1’).Value := ‘2012’;
ExcelSheet.Range(‘A2′).Value := Customer.”Sales (LCY)”;

Customer.SETFILTER(“Date Filter”,’%1..%2’,010113D,311213D);
Customer.CALCFIELDS(“Sales (LCY)”);
ExcelSheet.Range(‘B1’).Value := ‘2013’;
ExcelSheet.Range(‘B2′).Value := Customer.”Sales (LCY)”;

Customer.SETFILTER(“Date Filter”,’%1..%2’,010114D,311214D);
Customer.CALCFIELDS(“Sales (LCY)”);
ExcelSheet.Range(‘C1’).Value := ‘2014’;
ExcelSheet.Range(‘C2’).Value := Customer.”Sales (LCY)”;

ExcelRange := ExcelSheet.Range(‘A1:C2’);
ExcelChart := ExcelBook.Charts.Add;
ExcelChart.Name := ‘Customergraph’;

ExcelChart.ChartWizard(ExcelRange,60,70,1,1,0,0,’Sales (LCY) Customer Pardaan Inc.’);


Download objects (NAV 2009 R2) : [download id=”133″]

Parameters ChartWizard Method
ChartType enumeration