How to Creat an Word Document with a Report ?
BT_Marc
Member Posts: 30
Hello,
First of all I have to say that I'm a beginner in programming.
I want to create a Word Document directly out of a Navision Report. Unfortunately I don't know the C/AL Code that will create a New Word document. First of all I have to create a new document with some text in it. Can some body tell my how I make it in Navision 3.70.0.14988 ?
Thanks for yor Help
Marc
First of all I have to say that I'm a beginner in programming.
I want to create a Word Document directly out of a Navision Report. Unfortunately I don't know the C/AL Code that will create a New Word document. First of all I have to create a new document with some text in it. Can some body tell my how I make it in Navision 3.70.0.14988 ?
Thanks for yor Help
Marc
0
Comments
-
You can save the report as HTML & open it in word.
Also in the Application Designers Guide (on Product CD) in "Extending C/al" Chapter there is a step by step example of how to write a letter in MS Word.0 -
I tried to save a report which had certain picture contols and some shape controls in html format and then opened the same in the word document but the formatting of the same had actually gone for a toss and in no way it was nice to see a word document as it should have looked.Diptish Naskar
For any queries you can also visit my blog site: http://msnavarena.blogspot.com/0 -
Yes it's not always pretty - that's why I prefer printing to PDF myself.
But if editing is involved then I use Crystal Reports which exports a report perfectly to word.
there are many ways to do this i guess. You could create the doc in word and use c/odbc or odbc to bring the data TO word instead of the other way around.0 -
TemplateName := 'Dokument.dot'; IF ISCLEAR(WordApp) THEN IF NOT CREATE(WordApp, FALSE) THEN ERROR('Konnte keine Word-Instanz erstellen!'); IF NOT EXISTS(TemplateName) THEN ERROR('Wordvorlage %1 existiert nicht!', TemplateName); WordDoc := WordApp.Documents.Add(TemplateName); WordRange := WordApp.ActiveDocument.Fields.Item(1).Result; WordRange.Text := '1. Textfeld im Dokument füllen'; WordRange := WordApp.ActiveDocument.Fields.Item(2).Result; WordRange.Text := '2. Textfeld im Dokument füllen'; WordApp.ScreenUpdating(TRUE); WordApp.Visible := TRUE; WordApp.Activate;
I found this Code
It needs some Globals:
Name DataType Subtype Length
TemplateName Text 255
WordApp Automation 'Microsoft Word 11.0 Object Library'.Application
WordDoc Automation 'Microsoft Word 11.0 Object Library'.Document
WordRange Automation 'Microsoft Word 11.0 Object Library'.Range
It locks like this is the right funktion but there is a bug an i don't finde it. can some body help me ?0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 328 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