AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 30.03.2010, 15:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,643 / 848 (80) +++++++
Регистрация: 28.10.2006
Shekhar: Dynamics AX : Document handling
Источник: http://shekhardiptiman.spaces.live.c...B978!382.entry
==============


The following solution is to use the document handling feature of AX and generate a word document by populating data into a word template. Following is the detail on how to do it .
When we create a new word document through document handling , we can transfer data from tables in Microsoft Dynamics AX to bookmarks in the new document. This is done by creating a template with some standard text and some bookmarks where the data from tables are to be inserted. For example we can transfer the address and contact information for a customer to the letter head in a Microsoft Word document when creating a new letter for that customer.
Prepare a Word template :We need to create a Word template with bookmarks where the data should be inserted. Then we set up the document type by linking the document type to the template and by adding the data fields to be transferred to the individual bookmarks.
Step A : Create a new Word template
1.            From the Start menu, click All Programs > Microsoft Office > Microsoft Office Word.
2.            In the new template, add the text and graphics we want to appear in all new documents that we base on the template.
3.            Place the cursor where we want to insert data from Microsoft Dynamics AX and then click Insert > Bookmark.
4.            Type a meaningful name for the bookmark and click Add.
5.            Repeat step 3 through 4 for each bookmark that we want in the template.
6.            On the File menu, click Save As.
7.            In File name, type a name for the new template.
8.            In Save as type, click Document Template, and then click Save.
 

Note : It is important to use a table where more than one row of data is needed. e.g. if we are expecting to insert more than one invoices for a vendor as shown in the above screen shot. This will help maintain the format when the data is populated by the system. Otherwise the data will be distorted.
Step B : Link the template to a document type
1.            Click Basic > Setup > Document management > Document types.
2.            Select the document type that we want to link to a template.
3.            Click Options.
4.            In the Table list, select the table to associate with the template.
5.            In the Template file list, type the path to the template file or use the browse button to locate the file on the computer or network.
Class description:             Create Word document via COM
Group:                                  Document          

Step C : Add bookmark information to table fields
1.            Click the button “Option”.. In the Options form, On overview tab give the name of the table and path of the template file
    select the table that is linked to the template that we want to use.

2.            Select the Fields tab.
3.            Press CTRL+N to add a field to be transferred.
4.            In the Data table list, select a table to get data from.
5.            In the Data field list, select the data field to get data from.
6.            In Bookmark, type the name of the bookmark we have inserted in the document where the data will be inserted.
7.            Select Hard return to insert a line break after the data inserted (optional).
8.            Repeat step 3 through 7 to add more data fields to the list.
Note : The table we get the data from does not have to match the table selected on the Overview tab, but the two tables have to be related.                 The Document handling feature can only create one letter per invoice.


On Field tab select the AX table and fields as shown below in the screen shot . For each field give the Bookmark from the template.

 




Step D : Test the report
Go to vendor master and select a vendor whose invoices have been  pending / on hold.
Click document handling button. Indocument handling click the Button New and select the document type created in previous Step B.
A word document will be created with data for the vendor Verify the data on the document. Pls note that the invoice number date and amount fields are nicely aligned . If the bookmarks had not been in a table in the template then the invoice details would have been distorted. ( try using  a template with bookmarks without table and see yourself )

 

I hope the above will be of help to many AX consultants in avoiding a few report customisations.











Источник: http://shekhardiptiman.spaces.live.c...B978!382.entry
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
paruvella: Dynamics Ax Document Handling For The Mails Using Drag n Drop Blog bot DAX Blogs 0 20.11.2009 20:05
paruvella: Dynamics Ax Document Handling using File Drag n Drop Blog bot DAX Blogs 0 12.11.2009 21:05
emeadaxsupport: List of fixes that improve performance of certain features in Dynamics AX 2009 Blog bot DAX Blogs 0 13.10.2009 19:06
Developer for Microsoft Dynamics AX Certification Roadmap Blog bot DAX Blogs 1 13.05.2009 16:17
axStart: Microsoft Dynamics AX 2009 Hot Topics Web Seminar Series Blog bot DAX Blogs 0 06.08.2008 12:05

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 00:38.