Search icon CANCEL
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Extending Microsoft Dynamics NAV 2016 Cookbook

You're reading from  Extending Microsoft Dynamics NAV 2016 Cookbook

Product type Book
Published in Jan 2017
Publisher Packt
ISBN-13 9781786460608
Pages 458 pages
Edition 1st Edition
Languages
Author (1):
Alexander Drogin Alexander Drogin
Profile icon Alexander Drogin

Table of Contents (17) Chapters

Extending Microsoft Dynamics NAV 2016 Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
1. Writing Basic C/AL Code 2. Advanced C/AL Development 3. Reporting and Data Analysis 4. .NET Interoperability in C/AL 5. Extending C/AL with COM Components 6. SharePoint Integration 7. Control Add-ins 8. Web Services 9. Events and Extension Packages 10. PowerShell

Creating a Word document using automation objects


Microsoft Word exposes its object model through COM automation the same way as Excel. The following example demonstrates how to export a dataset into a Word document via Automation variables. We will create a document containing a table and export a list of items in the Where-used report into the table.

The Where-used report is a list of assembled items, which includes the given item as a component in their bill of materials.

How to do it...

  1. Open C/SIDE page designer and create a list page. In the Table field, select the Item table. Run the page wizard and include two table fields in the page: No. and Description.

  2. After completing the wizard, open the page action designer and insert an Export action button that will be used to trigger document creation. In the Export - OnAction C/AL trigger insert one line of code:

            CreateWordDocument("No."); 
    
  3. In C/AL globals, declare the CreateWordDocument function just referenced in Step 2. One parameter...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}